Working with elements of type list

The XML Schema specification permits an element or attribute to contain a list of values based on a simple type with the individual values separated by white space. In the message tree, an xsd:list is represented as a name node with an anonymous child node for each list item. Repeating lists can be handled without any loss of information.

Consider the following XML input message:
   <message1>
   <listE1>one two three</listE1>
   </message1>
This XML element produces the following message tree:
 MRM
	listEl  (Name)
			"one"   (Value)
			"two"   (Value)
			"three" (Value)

Individual list items can be accessed as ElementName.*[n].

For example, the ESQL to access the third item of listE1 is
SET X = FIELDVALUE (InputBody.message1.listE1.*[3]);
An attribute can also be an xsd:list. Consider the following XML input message:
   <message1>
     <Element listAttr="one two three"/>
   </message1> 
This XML element produces the following message tree:
MRM
	Element	(Name)
			listAttr	(Name)
				"one"	(Value)
				"two"	(Value)
				"three" (Value)

As before, individual list items can be accessed as AttrName.*[n].

For example, the ESQL to access the third item of listAttr is:
SET X = FIELDVALUE (InputBody.message1.Element.listAttr.*[3]);

A list element can occur more than once.

Consider the following XML message:
	<message1>
     <listE1>one two three/listE1>
     <listE1>four five six/listE1>
	</message1> 
The message tree for this XML message is:
MRM
	listE1	(Name)
			"one"	(Value)
			"two"	(Value)
			"three" (Value)
	listE1	(Name)
			"four"	(Value)
			"five"	(Value)
			"six" (Value)
The ESQL to access the first item in the second occurrence of the list is:
SET X = FIELDVALUE (InputBody.message1.listE1[2].*[1]);
Related tasks
Developing ESQL
Accessing elements in the message body
Mapping between a list and a repeating element
Related reference
SET statement