Home | Top | ← | → | Overview | Module | Class | Index | Help |
|
About |
---|
|
||||
A class for XSD 1.0 model group definitions. <group id = ID maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 name = NCName ref = QName {any attributes with non-schema namespace . . .}> Content: (annotation?, (all | choice | sequence)?) </group> <all id = ID maxOccurs = 1 : 1 minOccurs = (0 | 1) : 1 {any attributes with non-schema namespace . . .}> Content: (annotation?, element*) </all> <choice id = ID maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 {any attributes with non-schema namespace . . .}> Content: (annotation?, (element | group | choice | sequence | any)*) </choice> <sequence id = ID maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 {any attributes with non-schema namespace . . .}> Content: (annotation?, (element | group | choice | sequence | any)*) </sequence>
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
Class Variables | |
mixed = False
|
|
model = None
|
|
redefine = None
|
|
Inherited from Inherited from |
Method Details |
|
|
|
|
Helper method for generating model validation errors. Incompatible with 'skip' validation mode. Il validation mode is 'lax' returns the error, otherwise raise the error. :param validation: the validation mode. Can be 'lax' or 'strict'. :param elem: the instance Element. :param index: the child index. :param particle: the XSD component (subgroup or element) associated to the child. :param occurs: the child tag occurs. :param expected: the expected element tags/object names. :param source: the XML resource related to the validation process. :param namespaces: is an optional mapping from namespace prefix to URI. :param _kwargs: keyword arguments of the validation process that are not used.
|
Property that is ``True`` if schema validator has been fully parsed and built, ``False`` otherwise.
|
The reference element of the schema for the component instance.
|
Property that returns the *validation status* of the XSD validator. It can be 'full', 'partial' or 'none'. | https://www.w3.org/TR/xmlschema-1/#e-validation_attempted | https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/#e-validation_attempted
|
|
Creates an iterator for XSD subcomponents. :param xsd_classes: provide a class or a tuple of classes to iterates over only a specific classes of components.
|
|
A generator function iterating model's elements. Raises `XMLSchemaModelDepthError` if the argument *depth* is over `MAX_MODEL_DEPTH` value. :param depth: guard for protect model nesting bombs, incremented at each deepest recursion.
|
Sort elements by group order, that maybe partial in case of 'all' or 'choice' ordering. The not matching elements are appended at the end.
|
Creates an iterator for decoding an Element content. :param elem: the Element that has to be decoded. :param validation: the validation mode, can be 'lax', 'strict' or 'skip. :param converter: an :class:`XMLSchemaConverter` subclass or instance. :param kwargs: keyword arguments for the decoding process. :return: yields a list of 3-tuples (key, decoded data, decoder), eventually preceded by a sequence of validation or decoding errors.
|
Creates an iterator for encoding data to a list containing Element data. :param element_data: an ElementData instance with unencoded data. :param validation: the validation mode: can be 'lax', 'strict' or 'skip'. :param converter: an :class:`XMLSchemaConverter` subclass or instance. :param kwargs: Keyword arguments for the encoding process. :return: Yields a couple with the text of the Element and a list of 3-tuples (key, decoded data, decoder), eventually preceded by a sequence of validation or encoding errors.
|
Update group occurrences. :param counter: a Counter object that trace occurrences for elements and groups.
|
A list with all the building errors of the XSD validator and its components.
|
Checks if the model group is deterministic. Types matching of same elements and Unique Particle Attribution Constraint are checked. Raises an `XMLSchemaModelError` at first violated constraint.
|
Decodes XML data using the XSD schema/component. :param source: the source of XML data. For a schema can be a path to a file or an URI of a resource or an opened file-like object or an Element Tree instance or a string containing XML data. For other XSD components can be a string for an attribute or a simple type validators, or an ElementTree's Element otherwise. :param args: arguments that maybe passed to :func:`XMLSchema.iter_decode`. :param kwargs: keyword arguments from the ones included in the optional arguments of the :func:`XMLSchema.iter_decode`. :return: a dictionary like object if the XSD component is an element, a group or a complex type; a list if the XSD component is an attribute group; a simple data type object otherwise. If *validation* argument is 'lax' a 2-items tuple is returned, where the first item is the decoded object and the second item is a list containing the errors. :raises: :exc:`XMLSchemaValidationError` if the object is not decodable by the XSD component, or also if it's invalid when ``validation='strict'`` is provided.
|
Helper method for generating decode errors. Incompatible with 'skip' validation mode. Il validation mode is 'lax' returns the error, otherwise raises the error. :param validation: an error-compatible validation mode: can be 'lax' or 'strict'. :param obj: the not validated XML data. :param decoder: the XML data decoder. :param reason: the detailed reason of failed validation. :param source: the XML resource that contains the error. :param namespaces: is an optional mapping from namespace prefix to URI. :param _kwargs: keyword arguments of the validation process that are not used.
|
Property that references to schema's default namespaces.
|
Encodes data to XML using the XSD schema/component. :param obj: the data to be encoded to XML. :param args: arguments that maybe passed to :func:`XMLSchema.iter_encode`. :param kwargs: keyword arguments from the ones included in the optional arguments of the :func:`XMLSchema.iter_encode`. :return: An element tree's Element if the original data is a structured data or a string if it's simple type datum. If *validation* argument is 'lax' a 2-items tuple is returned, where the first item is the encoded object and the second item is a list containing the errors. :raises: :exc:`XMLSchemaValidationError` if the object is not encodable by the XSD component, or also if it's invalid when ``validation='strict'`` is provided.
|
Helper method for generating encode errors. Incompatible with 'skip' validation mode. Il validation mode is 'lax' returns the error, otherwise raises the error. :param validation: an error-compatible validation mode: can be 'lax' or 'strict'. :param obj: the not validated XML data. :param encoder: the XML encoder. :param reason: the detailed reason of failed validation. :param source: the XML resource that contains the error. :param namespaces: is an optional mapping from namespace prefix to URI. :param _kwargs: keyword arguments of the validation process that are not used.
|
|
The ``'id'`` attribute of the component tag, ``None`` if missing.
|
|
Is `True` if the instance is a global component, `False` if it's local.
|
Returns `True` if the component name is matching the name provided as argument, `False` otherwise. :param name: a local or fully-qualified name. :param default_namespace: used if it's not None and not empty for completing the name argument in case it's a local name.
|
Returns `True` if the group may be eliminated without affecting the model, `False` otherwise. A group is pointless if one of those conditions is verified:
Ref: https://www.w3.org/TR/2004/REC-xmlschema_acue-1-20041028/#coss-particle :param parent: effective parent of the model group.
|
Like :meth:`validate` except that do not raises an exception but returns ``True`` if the XML document is valid, ``False`` if it's invalid. :param source: the source of XML data. For a schema can be a path to a file or an URI of a resource or an opened file-like object or an Element Tree instance or a string containing XML data. For other XSD components can be a string for an attribute or a simple type validators, or an ElementTree's Element otherwise. :param use_defaults: indicates whether to use default values for filling missing data.
|
Creates an iterator for XSD ancestor components, schema excluded. Stops when the component is global or if the ancestor is not an instance of the specified class/classes. :param xsd_classes: provide a class or a tuple of classes to iterates over only a specific classes of components.
|
Creates an iterator for the errors generated by the validation of an XML data against the XSD schema/component instance. :param source: the source of XML data. For a schema can be a path to a file or an URI of a resource or an opened file-like object or an Element Tree instance or a string containing XML data. For other XSD components can be a string for an attribute or a simple type validators, or an ElementTree's Element otherwise. :param path: is an optional XPath expression that defines the parts of the document that have to be validated. The XPath expression considers the schema as the root element with global elements as its children. :param use_defaults: Use schema's default values for filling missing data. :param namespaces: is an optional mapping from namespace prefix to URI.
|
A generator function iterating elements and groups of a model group. Skips pointless groups, iterating deeper through them. Raises `XMLSchemaModelDepthError` if the argument *depth* is over `MAX_MODEL_DEPTH` value. :param depth: guard for protect model nesting bombs, incremented at each deepest recursion.
|
|
Property that references to schema's global maps.
|
Property that references to schema's namespace mapping.
|
|
Helper method for registering parse errors. Does nothing if validation mode is 'skip'. Il validation mode is 'lax' collects the error, otherwise raise the error. :param error: can be a parse error or an error message. :param elem: the Element instance related to the error, for default uses the 'elem' attribute of the validator, if it's present.
|
|
|
Property that references to schema source.
|
Property that references to schema's targetNamespace.
|
Decodes XML data using the XSD schema/component. :param source: the source of XML data. For a schema can be a path to a file or an URI of a resource or an opened file-like object or an Element Tree instance or a string containing XML data. For other XSD components can be a string for an attribute or a simple type validators, or an ElementTree's Element otherwise. :param args: arguments that maybe passed to :func:`XMLSchema.iter_decode`. :param kwargs: keyword arguments from the ones included in the optional arguments of the :func:`XMLSchema.iter_decode`. :return: a dictionary like object if the XSD component is an element, a group or a complex type; a list if the XSD component is an attribute group; a simple data type object otherwise. If *validation* argument is 'lax' a 2-items tuple is returned, where the first item is the decoded object and the second item is a list containing the errors. :raises: :exc:`XMLSchemaValidationError` if the object is not decodable by the XSD component, or also if it's invalid when ``validation='strict'`` is provided.
|
Encodes data to XML using the XSD schema/component. :param obj: the data to be encoded to XML. :param args: arguments that maybe passed to :func:`XMLSchema.iter_encode`. :param kwargs: keyword arguments from the ones included in the optional arguments of the :func:`XMLSchema.iter_encode`. :return: An element tree's Element if the original data is a structured data or a string if it's simple type datum. If *validation* argument is 'lax' a 2-items tuple is returned, where the first item is the encoded object and the second item is a list containing the errors. :raises: :exc:`XMLSchemaValidationError` if the object is not encodable by the XSD component, or also if it's invalid when ``validation='strict'`` is provided.
|
Validates an XML data against the XSD schema/component instance. :param source: the source of XML data. For a schema can be a path to a file or an URI of a resource or an opened file-like object or an Element Tree instance or a string containing XML data. For other XSD components can be a string for an attribute or a simple type validators, or an ElementTree's Element otherwise. :param use_defaults: indicates whether to use default values for filling missing data. :param namespaces: is an optional mapping from namespace prefix to URI. :raises: :exc:`XMLSchemaValidationError` if XML *data* instance is not a valid.
|
Helper method for generating and updating validation errors. Incompatible with 'skip' validation mode. Il validation mode is 'lax' returns the error, otherwise raises the error. :param validation: an error-compatible validation mode: can be 'lax' or 'strict'. :param error: an error instance or the detailed reason of failed validation. :param obj: the instance related to the error. :param source: the XML resource related to the validation process. :param namespaces: is an optional mapping from namespace prefix to URI. :param _kwargs: keyword arguments of the validation process that are not used.
|
Property that returns the XSD validator's validity. It can be âvalidâ, âinvalidâ or ânotKnownâ. | https://www.w3.org/TR/xmlschema-1/#e-validity | https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/#e-validity
|
Home | Top | ← | → | Overview | Module | Class | Index | Help |
|
About |
---|
Copyright(C) 2019 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez | https://arnocan.wordpress.com |
Generated by Epydoc 4.0.4 / Python-3.8 / fedora27 on Fri Dec 13 15:25:24 2019 | http://epydoc.sourceforge.net |