An xsd:list
type is used to model a space-separated list of values of a given
type. This type is mapped to a linked-list type if its length is unbounded, or an array type
if its length is bounded. The built-in OSRTDList
type (run-time doubly linked
list) is the type used for repeating sequences such as this. This list type can be used with
the rtxDList run-time functions for building and manipulating
lists. See the Doubly-Linked List Utility Functions section
for more details.
In the case of C++, the built-in OSRTDListClass or OSRTObjListClass type is used. These classes extend the C OSRTDList structure and add constructors and methods for adding, finding, and removing items from the list. The generated C++ code contains overloaded versions of these methods that correspond to the specific type of the element within the list.
If -use-qt is used with C++, Qt collection classes are used instead of the linked-list
classes OSRTDListClass and
OSRTObjListClass. For an xsd:list
with an
item type of xsd:string
, QStringList is used.
The general C and C++ mapping for an XSD list type is as follows: