xsd.Schema

The xsd.Schema class represents a Schema as a whole schema component as described in the XML Schema specification. It provides properties to access the different top-level xsd.Component objects and the xsd.SchemaDocument objects used to compose this xsd.Schema.

class xsd.Schema

Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a NotImplementedError exception.

Class methods

classmethod xsd.Schema.create_from_buffer(type cls, buf, *, catalog=None, **kargs)

Returns a tuple with an xsd.Schema and xml.ErrorLog object. Constructs a new xsd.Schema object after parsing the XML content in the given buffer according to the W3C XML Schema Definition Language (XSD) 1.0 and 1.1 specification. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlserver/rxcli_xmlval_xsd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xsd.Schema.create_from_url(type cls, url, *, catalog=None, **kargs)

Returns a tuple with an xsd.Schema and xml.ErrorLog object. Constructs a new xsd.Schema object after parsing the XML content retrieved from the given url according to the W3C XML Schema Definition Language (XSD) 1.0 and 1.1 specification. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlserver/rxcli_xmlval_xsd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xsd.Schema.validate_buffer(type cls, buf, *, catalog=None, **kargs)

Validates the XML Schema document from the given buffer buf according to the W3C XML Schema Definition Language (XSD) 1.0 and 1.1 specification and returns xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xmlval_xsd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xsd.Schema.validate_url(type cls, url, *, catalog=None, **kargs)

Validates the XML Schema document at the given url according to the W3C XML Schema Definition Language (XSD) 1.0 and 1.1 specification and returns xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xmlval_xsd.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

Attributes

xsd.Schema.annotations

Returns an iterator of xsd.Annotation components for this xsd.Schema.

xsd.Schema.attribute_declarations

Returns an iterator of all top-level xsd.AttributeDeclaration components.

xsd.Schema.attribute_group_definitions

Returns an iterator of all top-level xsd.AttributeGroupDefinition components.

xsd.Schema.documents

Returns an iterator of all xsd.SchemaDocument objects part of this xsd.Schema.

xsd.Schema.element_declarations

Returns an iterator of all top-level xsd.ElementDeclaration components.

xsd.Schema.identity_constraint_definitions

Returns an iterator of all xsd.IdentityConstraintDefinition components.

xsd.Schema.model_group_definitions

Returns an iterator of all top-level xsd.ModelGroupDefinition components.

xsd.Schema.notation_declarations

Returns an iterator of all top-level xsd.NotationDeclaration components.

xsd.Schema.type_definitions

Returns an iterator of all top-level xsd.SimpleTypeDefinition and xsd.ComplexTypeDefinition components.

Methods

xsd.Schema.find_document(uri)

Returns the xsd.SchemaDocument with the given URI, or None if no such xsd.SchemaDocument is part of the xsd.Schema.

xsd.Schema.resolve_attribute_declaration(name)

Returns the top-level xsd.AttributeDeclaration with the given name. Name may be either a xml.QName or a tuple of local name and optional namespace name.

xsd.Schema.resolve_attribute_group_definition(name)

Returns the top-level xsd.AttributeGroupDefinition with the given name. Name may be either a xml.QName or a tuple of local name and optional namespace name.

xsd.Schema.resolve_element_declaration(name)

Returns the top-level xsd.ElementDeclaration with the given name. Name may be either a xml.QName or a tuple of local name and optional namespace name.

xsd.Schema.resolve_identity_constraint_definition(name)

Returns the xsd.IdentityConstraintDefinition with the given name. Name may be either a xml.QName or a tuple of local name and optional namespace name.

xsd.Schema.resolve_model_group_definition(name)

Returns the top-level xsd.ModelGroupDefinition with the given name. Name may be either a xml.QName or a tuple of local name and optional namespace name.

xsd.Schema.resolve_notation_declaration(name)

Returns the top-level xsd.NotationDeclaration with the given name. Name may be either a xml.QName or a tuple of local name and optional namespace name.

xsd.Schema.resolve_type_definition(name)

Returns the top-level xsd.SimpleTypeDefinition or xsd.ComplexTypeDefinition with the given name. Name may be either a xml.QName or a tuple of local name and optional namespace name.

xsd.Schema.sample_xml(name=None, SampleXMLGeneratorOptions options=None)

Generates a XML sample for this schema. name specifies the name of the root element. If no name is specified then the method tries to autodetect a suitable root element. A xml.SampleXMLGeneratorOptions instance can be used to configure the generator behavior. If no options are specified then a default xml.SampleXMLGeneratorOptions instance is used.

Special methods

__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__