Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / LiveCycle Developer Center /

Binding an XML Schema Document (XSD) to repeating subform elements using Adobe LiveCycle Designer

by Benjamin P. Lyons

Benjamin P. Lyons
  • www.twintechs.com

Content

  • Introduction
  • Creating Dynamic Fields
  • Create a Schema that Contains a Node to Mimic the Repeating Subform
  • Bind the Repeating Form Object to the Schema

Created

28 March 2011

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
forms LiveCycle XML

Requirements

Prerequisite knowledge

A working knowledge of LiveCycle Designer; principles of XSD schema development

User level

Intermediate

Required products

  • LiveCycle Designer ES2 (Download trial)

Sample files

  • repeating-subform-sample (945 KB)

Additional required other products (third-party/labs/open source)

  • An XML/XSD editor program of one’s choice

    or

  • A text editor program (like Notepad++)

Introduction

The problem that this article aims to solve is how to bind dynamic form fields to an XML Schema Document (XSD) element using LiveCycle Designer ES. 

Dynamic interaction with electronic forms is one of LiveCycle’s most attractive features.  Having a form conform to the size document required for a particular transaction can save on printing costs (if the form needs to be printed) and by presenting only the amount of information required to complete a transaction, a form is easier to read and understand by a user.  Form objects, like buttons, can be used to add or delete the required number of data-input fields from a form.  

Data captured by a form’s objects are stored within the form as XML data.  In order to feed this XML data to back-end services, the XML needs to be structured.  By default, the XML data that is output in a form conforms to an XML Path (XPath) structure that mimics the layout of the form objects themselves and their relation to their position on the form.  This method of naming XPaths often isn’t useful to a back-end developer, so in order to structure the XML being output from a form in a manner that is logical to the back-end developer, an XSD document is used. 

The XSD document is basically a schema or rule-set document written in the XML mark-up language.  This XSD describes how the XML data should be structured when it is extracted from the form.  Once a form object has been bound to the schema elements, the data captured in the form becomes stored in an XML document in the format as described by the XSD.

The issue at hand is: how does one bind an element of a dynamically repeating form object to a schema element?  After all, the objects only appear in the form structure once and in the schema structure once, but could be used to store several sets of data.  This document seeks to explain the forms’ structural requirements and binding conventions required to bind a form to a schema for these sets of repeating data.

The form that will be used as an example for this tutorial (see Figure 1) is a simple form that one could use to petition a site administrator to allow its corporate partners to have some power users use the corporate Web site.  The number of users varies, so in order for the site administrator to add the appropriate amount of users, an “Add User” button is added.  By pressing this button, a new block of users appears, which captures the same information: User First Name, User Last Name, Add/Change/Delete (the named user), User Phone Number, and User Email Address.

The form used as an example for this tutorial
Figure 1. The form used as an example for this tutorial

Creating Dynamic Fields

First, a form needs to be constructed that contains the desired repeating field functionality.  This is achieved by creating a form with a flowed layout.  A flowed layout is not a static layout.  Rather, as the name implies, a flowed layout can change size and expand or retract as needed.  By default, a flowed layout will stack all form objects on top of each other and align them to the left. Since this does not adequately use up the form’s real estate (usable whitespace area on a form), one needs to use either a table, or preferably, a subform that has a positioned layout within the flowed layout.

Create a SubForm That has a Flowed Layout

It does not matter if one makes the entire page, or a wrapped subform the flowed section, it only needs to be flowed.

Note: If you are making the entire page flowed, you would do this by right clicking on the item in the form object hierarchy that represents the page in the design view (by default this is called, “(untitled Subform)(page 1)”. Be sure that you are not right-clicking on the “Page1” object under the “(Master Pages)” object.

To create a new subform:

  1. Right-click on the page in the form-object hierarchy (by default on the left side of Designer)
  2. In the pop-up menu that appears, select “Insert Subform”
  3. Name your subform accordingly (in the example shown below this object has been named “UserDesigneeContainer”)
  4. Be sure that the “Content” setting in the “Subform” tab under the “Object” Palette is set to “Flowed”

Within the Flowed Subform, Create a Subform that has a Positioned Layout

  1. Right-click on the newly created flowed subform in the form-object hierarchy
  2. In the pop-up menu that appears, select “Insert Subform”
  3. Name your subform accordingly (in the example shown below this object has been named “UserDesigneeSubform”)
  4. Be sure that the “Content” setting in the “Subform” tab under the “Object” Palette is set to “Positioned”
  5. Add the form elements that will be repeated in this subform (as shown in Figures 2 and 3 below)
Add  the form elements that will be repeated in this subform
Figure 2. Add the form elements that will be repeated in this subform.
 Add  the form elements that will be repeated in this subform
Figure 3. Add the form elements that will be repeated in this subform.

Create a Schema that Contains a Node to Mimic the Repeating Subform

XML schema development is out-of-scope for this tutorial, but one must create an XML schema for the form and then create a data connection between the form and the schema. Information on how to establish a data connection between a form and an XML schema is available in the Adobe LiveCycle documentation.

An XML schema can be developed with any XML or XSD schema development tool, or it can simply be made with a simple text editor like the open source product Notepad ++.  The one requisite trait about the XML schema is that one must include a section that mimics the structure of the repeating subform.

In the example shown above, the “UserDesigneeSubform” has a few data-capture elements, namely:

  • UserFirstNm – a text field
  • UserLastNm – a text field
  • UserAddChangeDelIn – a drop-down list selector
  • UserTelNo – a text field (could also be a numeric field)
  • UserEmailAd – a text field

This means that the XML schema document must also have the same elements defined (as shown in Figure 4 below).  Note that both the containing “flowed” object (UserDesigneeContainer) and the subform “positioned” object (UserDesigneeSubform) need to have the attribute “maxOccurs” set to unbounded.  Note also how the repeating “UserDesigneeSubform” object must also be embedded within the “UserDesigneeContainer” object to reflect its position in the form hierarchy in Designer.

 The XML schema document must also have the same elements defined
Figure 4. The XML schema document must also have the same elements defined.

Bind the Repeating Form Object to the Schema

Once the schema has been developed, and the data connection established, one can begin the process of binding the forms elements to the schema. You can find information on binding fields to a data source here.

Use the Bracketed Asterisk Convention “[*]”

The one difference between a typical binding of a form object to an XML schema, is that the developer must also include a bracketed asterisk “[*]” in the binding path in Designer (as shown in Figure 5 below).

A bracketed asterisk “[*]” must be included in the binding path in LiveCycle Designer
Figure 5. A bracketed asterisk “[*]” must be included in the binding path in LiveCycle Designer.

That’s all that is required to bind the repeating subform to the XSD.  Now when a user adds a section to the form for completion, another identical XML output node will appear (as shown in Figure 6 below).

When a user adds a section to the form for completion, another identical XML output node will appear
Figure 6. When a user adds a section to the form for completion, another identical XML output node will appear.

Where to go from here

This tutorial explained how to create a repeating subform in LiveCycle Designer, and how to bind that subform to an XSD in such a way that it dynamically adds XML output data to identically structured nodes in the XML output file.

  • For more information on the general principles of XSD creation, refer to the w3schools website.
  • For specific details about XML schemas and Designer, refer to the Adobe LiveCycle Designer Help.


This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License.

More Like This

  • Extending your forms for use inside of Adobe LiveCycle Workspace ES by adding reader rights
  • Using dot leaders in LiveCycle Designer ES Update 1
  • Creating an XML electronic forms solution with an Adobe PDF form and IBM DB2 pureXML
  • Displaying a list of participants for a review stage in e-mail for Managed Review & Approval Solution Accelerator 9.5
  • Pre-populating dropdown lists in dynamic PDF forms from a back-end data source using LiveCycle ES2.5
  • Foundation Form Creation excerpt: Getting into advanced form design
  • Creating form rendering ASP.NET applications
  • Introduction to hyphenation in Adobe LiveCycle Designer ES Update 1
  • Introduction to typography enhancements in LiveCycle Designer ES Update 1
  • Using the Execute Script Service in LiveCycle Workbench ES2 to build XML data

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement