defxmlschema/chapter08 ====================== Example 8-1 Defining and referencing a named simple type -------------------------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0801.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0801.py :language: python Example 8-10 Restricting an enumeration --------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0810.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0810.py :language: python Example 8-12 Using a union to extend an enumeration --------------------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0812.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0812.py :language: python Example 8-13 Enumerating numeric values --------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example08131.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example08131.py :language: python Example 8-14 Applying the pattern facet --------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0814.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0814.py :language: python Example 8-15 Restricting a pattern ---------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0815.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0815.py :language: python Example 8-2 Defining an anonymous simple type --------------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0802.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0802.py :language: python Example 8-21 Preventing type derivation --------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0821.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0821.py :language: python Example 8-3 Deriving a simple type from a built-in simple type -------------------------------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0803.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0803.py :language: python Example 8-4 Deriving a simple type from a user-derived simple type ------------------------------------------------------------------ .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0804.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0804.py :language: python Example 8-5 Effective definition of MediumDressSizeType ------------------------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0805.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0805.py :language: python Example 8-7 Fixed facets ------------------------ .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0807.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0807.py :language: python Example 8-8 Union allowing an empty value ----------------------------------------- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0808.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0808.py :language: python Example 8-9 Applying the enumeration facet ------------------------------------------ .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0809.xsd :language: xml :lines: 3- .. literalinclude:: /../tests/fixtures/defxmlschema/chapter08/example0809.py :language: python .. admonition:: Samples Source :class: hint `Definitive XML Schema `_ by Priscilla Walmsley (c) 2012 Prentice Hall PTR