********** Chapter 13 ********** Deriving complex types ====================== Binding Test ************ **Schema** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/chapter13.xsd :language: xml :lines: 2- **XML Document** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/chapter13.xml :language: xml :lines: 2- **xsData XML Document** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/chapter13.xsdata.xml :language: xml :lines: 2- **xsData JSON** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/chapter13.json :language: json Example 13-1 Simple content extension ************************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13011.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13011.py :language: python Example 13-2 Complex content extension ************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1302.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1302.py :language: python Example 13-3 Effective content model of ShirtType ************************************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1303.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1303.py :language: python Example 13-4 choice group extension *********************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1304.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1304.py :language: python Example 13-5 all group extension ******************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1305.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1305.py :language: python Example 13-6 Effective content model of ShirtType with all groups combined ************************************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1306.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1306.py :language: python Example 13-7 Extending open content *********************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1307.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1307.py :language: python Example 13-8 Mixed content extension ************************************ .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1308.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1308.py :language: python Example 13-9 Empty content extension ************************************ .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1309.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1309.py :language: python Example 13-10 Attribute extension ********************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13101.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13101.py :language: python Example 13-11 Attribute wildcard extension ****************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1311.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1311.py :language: python Example 13-12 Effective attribute wildcard ****************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1312.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1312.py :language: python Example 13-13 Simple content restriction **************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1313.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1313.py :language: python Example 13-14 Complex content restriction ***************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1314.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1314.py :language: python Example 13-26 Restricting open content ************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13261.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13261.py :language: python Example 13-26 Restricting open content ************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13262.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13262.py :language: python Example 13-26 Restricting open content ************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13263.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13263.py :language: python Example 13-27 Mixed content restriction *************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1327.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1327.py :language: python Example 13-28 Mixed content restricted to simple content ******************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1328.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1328.py :language: python Example 13-29 Empty content restriction *************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1329.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1329.py :language: python Example 13-30 Legal restrictions of attributes ********************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1330.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1330.py :language: python Example 13-32 Restricting an attribute wildcard *********************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1332.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1332.py :language: python Example 13-33 Replacing an attribute wildcard with attributes ************************************************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1333.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1333.py :language: python Example 13-34 Restricting a type from another namespace with global declarations ******************************************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13341.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13341.py :language: python Example 13-34 Restricting a type from another namespace with global declarations ******************************************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13342.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13342.py :language: python Example 13-35 Using targetNamespace on element and attribute declarations ************************************************************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13351.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13351.py :language: python Example 13-35 Using targetNamespace on element and attribute declarations ************************************************************************* .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13352.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example13352.py :language: python Example 13-36 A derived type **************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1336.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1336.py :language: python Example 13-38 Preventing derivation *********************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1338.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1338.py :language: python Example 13-39 Preventing substitution of derived types ****************************************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1339.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1339.py :language: python Example 13-41 An abstract type ****************************** .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1341.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter13/example1341.py :language: python .. admonition:: Samples Source :class: hint `Definitive XML Schema `_ by Priscilla Walmsley (c) 2012 Prentice Hall PTR