Package xmlschema_acue :: Package validators :: Module schema

Module schema

source code


This module contains XMLSchema classes creator for xmlschema_acue package.

Two schema classes are created at the end of this module, XMLSchema10 for XSD 1.0 and
XMLSchema11 for XSD 1.1. The latter class parses also XSD 1.0 schemas, as prescribed by
the standard.

Those are the differences between XSD 1.0 and XSD 1.1 and their current development status:

  * All model extended for content groups
  * Assertions for simple types
  * Default attributes for complex types
  * Alternative type for elements
  * Inheritable attributes
  * targetNamespace for restricted element and attributes
  * Assert for complex types
  * TODO: OpenContent and XSD 1.1 wildcards for complex types
  * schema overrides

Classes
  XMLSchemaMeta
  XMLSchemaBase
Base class for an XML Schema instance.
  XMLSchema10
XSD 1.0 schema class.
  XMLSchema11
XSD 1.1 schema class.
  XMLSchema
The default class for schema instances.
Variables
  ATTRIBUTE_GROUP_ELEMENT = etree_element(XSD_ATTRIBUTE_GROUP)
  ANY_ATTRIBUTE_ELEMENT = etree_element(XSD_ANY_ATTRIBUTE, attri...
  SEQUENCE_ELEMENT = etree_element(XSD_SEQUENCE)
  ANY_ELEMENT = etree_element(XSD_ANY, attrib= {'namespace': '##...
  SCHEMAS_DIR = os.path.join(os.path.dirname(__file__), 'schemas/')
  XML_SCHEMA_FILE = os.path.join(SCHEMAS_DIR, 'xml_minimal.xsd')
  HFP_SCHEMA_FILE = os.path.join(SCHEMAS_DIR, 'XMLSchema-hasFace...
  XSI_SCHEMA_FILE = os.path.join(SCHEMAS_DIR, 'XMLSchema-instanc...
  XLINK_SCHEMA_FILE = os.path.join(SCHEMAS_DIR, 'xlink.xsd')
Variables Details

ANY_ATTRIBUTE_ELEMENT

Value:
etree_element(XSD_ANY_ATTRIBUTE, attrib= {'namespace': '##any', 'proce\
ssContents': 'lax'})

ANY_ELEMENT

Value:
etree_element(XSD_ANY, attrib= {'namespace': '##any', 'processContents\
': 'lax', 'minOccurs': '0', 'maxOccurs': 'unbounded'})

HFP_SCHEMA_FILE

Value:
os.path.join(SCHEMAS_DIR, 'XMLSchema-hasFacetAndProperty_minimal.xsd')

XSI_SCHEMA_FILE

Value:
os.path.join(SCHEMAS_DIR, 'XMLSchema-instance_minimal.xsd')