Salesforce

How Do I Handle Multi-Occurrence Elements in an XML Doc? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Handle Multi-Occurrence Elements in an XML Doc? (Magic xpa 3.x)

Multi-Occurrence elements in an XML document are handled the same way that “child” records are handled in ISAM or SQL data sources. The child records are displayed in a subtask, in a child form or subform, and are displayed using a range so only the records that relate to the parent are shown.

Below are details for how to create programs using recurring XML elements.

Hint: You can tell the repeatable elements in a schema from within Magic xpa by looking at the icon. Repeatable elements have square brackets around them. You can tell the repeatable elements in the schema because they have maxOccurs="unbounded” or maxOccurs=>1.

Displaying repeatable elements

  1. First, you need to have an XML view for the repeatable element. In this example, we include the “sn” field, which is the linking field, and the repeatable element “starName”.

  2. On this XML view, we also create an index so we can access the elements by “sn”.

  3. We create task that displays the parent element, Title. In this task we select the /sn field. We pass the /sn field as a parameter to the subtask.

  4. We also create a subtask, which accesses the starName XML view. The index used here is the /sn field, and we use that same field as the parameter, to range the view.

  5. A Subform is used on the parent form to display the subtask (See the Subforms chapter).

Now the repeating elements will display in the subform.

See also

The Online and Rich Client Samples projects (program XM06 and RXM06)

Reference
Attachment 
Attachment