This section provides a tutorial example on how list datatypes and list union datatypes are now allowed as item datatypes to construct nested list datatypes.
Can we construct a list datatype using another list datatype as the item datatype to build a "two-dimensional" list?
The answer is now. I think the reason is that the "list" component does not allow you specify your own item delimiter.
If the outer list and the inner list both use the default whitespace as delimiters, there is no way to know to know where
is the end of the first item of the outer list.
For example, the following XSD document tries to use "list" components on list datatypes to define 2 new simple datatypes:
When validating this XSD document with my XsdSchemaChecker.java program presented earlier in the book,
I get these errors:
c:\Progra~1\Java\jdk1.7.0_07\bin\java XsdSchemaChecker
nested_list_test_invalid.xsd
Error:
Line number: 25
Column number: 37
Message: cos-st-restricts.2.1: In the definition of list type
'#AnonType_ListOfListNest_List_Test', type 'list' is an invalid
item type because it is either a list type, or a union type that
contains a list.
Error:
Line number: 31
Column number: 42
Message: cos-st-restricts.2.1: In the definition of list type
'#AnonType_ListOfListUnionNest_List_Test', type 'listUnion' is an
invalid item type because it is either a list type, or a union
type that contains a list.
Schema File: nested_list_test_invalid.xsd
Parser Class: com.sun.org.apache.xerces.internal.jaxp.validation
.SimpleXMLSchema
Failed with 2 errors.