Routing API Developer's Guide

xs:list

XML Schema provides a list type allowing more than one item within a single XML element. Items are separated by space.

The following example defines a list element named "Foo" which contains string elements.

<xs:simpleType name="MyListType">
  <xs:list itemType="xs:string"/>
</xs:simpleType>
<xs:element name="Foo" type="MyListType">

A valid instantiation of the "Foo" element would be

<Foo>ABC DEF GHI</Foo>

In this example, the "Foo" element contains the three items "ABC", "DEF", and "GHI".

In representation formats other than XML, the space as separator sometimes becomes unhandy. Therefore, a standard representation format for list types is defined for each representation format below.

Query Parameter Representation

In query strings, items of list types are separated by one of the following characters:

"," (comma) is used at top level
<Foo[0]> + "," + <Foo[1]> + "," + <Foo[2]> + "," + …
";" (semicolon) is used at second level, or if comma is already used in the representation of the list items
<Foo[0]> + ";" + <Foo[1]> + ";" + <Foo[2]> + ";" + …
"!" (exclamation point) is used at third level, or if comma and semicolon are already used in the representation of the list items
<Foo[0]> + "!" + <Foo[1]> + "!" + <Foo[2]> + "!" + …

The following syntax is introduced as shortcut to represent list types:

<Foo[]>
Note: List types and element sequences are represented in the same manner (see also xs:sequence).

JSON Representation

List types are represented as arrays:

[<list[0]>, <list[1]>, <list[2]>, …]