Defining Lists in an XML Framework Model

Lists can be defined within Serializations and Serializable classes to represent repeating elements in an XML message format.

A List can be defined in either of the following ways:

To understand the usage of List we can use the following example. This is a simple XML message with a repeating element:

<?xml version="1.0"?>
<People>
 <Surname>Smith</ Surname >
< Surname >Jones</ Surname >
< Surname >Harris</ Surname >
</People>

To define a List Attribute to represent the repeating <Surname> element, perform the following:

  1. Right-click the Serialization that represents the “People” message format, point to Add, and then select Attribute from the context menu.

    The Add New Attribute dialog box appears.

  2. In the Template box, enter or browse to the type that this attribute will derive from. For example, the Primitive type for Surname. This can be any Primitive type, Class, or Serialization.

  3. In the Name box, enter an appropriate name; for example, Surname.

  4. Select the List check box.

  5. Click Create.

A corresponding List attribute must be defined within the class that implements the above Serialization.