********** Chapter 10 ********** Union and list types ==================== Binding Test ************ **Schema** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/chapter10.xsd :language: xml :lines: 2- **XML Document** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/chapter10.xml :language: xml :lines: 2- **xsData XML Document** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/chapter10.xsdata.xml :language: xml :lines: 2- **xsData JSON** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/chapter10.json :language: json Example 10-1 Defining a union type ********************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1001.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1001.py :language: python Example 10-2 Using the memberTypes attribute ******************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1002.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1002.py :language: python Example 10-3 Combining memberTypes and simpleType ************************************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1003.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1003.py :language: python Example 10-4 Restricting a union ******************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1004.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1004.py :language: python Example 10-5 A union of a union ******************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1005.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1005.py :language: python Example 10-7 Defining a list type using an itemType attribute ************************************************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1007.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1007.py :language: python Example 10-9 Defining a list type using a simpleType child ********************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1009.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1009.py :language: python Example 10-10 Length facet applied to a list ******************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1010.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1010.py :language: python Example 10-12 Enumeration applied inappropriately to a list type **************************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1012.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1012.py :language: python Example 10-13 Enumeration applied to the item type of a list ************************************************************ .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1013.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1013.py :language: python Example 10-14 Enumeration correctly applied to a list type ********************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1014.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1014.py :language: python Example 10-15 Pattern applied to a list type ******************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1015.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1015.py :language: python Example 10-16 Defining a list of a string-based type **************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1016.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1016.py :language: python Example 10-18 Defining a list of a union **************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1018.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example1018.py :language: python Example 10-21 An array using markup *********************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example10211.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter10/example10211.py :language: python .. admonition:: Samples Source :class: hint `Definitive XML Schema `_ by Priscilla Walmsley (c) 2012 Prentice Hall PTR