xsd.ComplexTypeDefinition¶
xsd.ComplexTypeDefinition objects provide for:
Constraining
xml.ElementInformationItemobjects by providingxsd.AttributeDeclarationobjects governing the appearance and content of attributes.Constraining
xml.ElementInformationItemchildren to be empty, or to conform to a specified element-only or mixed content model, or else constraining thexml.CharDataInformationItemchildren to conform to a specifiedxsd.SimpleTypeDefinition.Constraining elements and attributes to exist, not to exist, or to have specified values, with
xsd.Assertionobjects.Using the mechanisms of Type Definition Hierarchy to derive a
xsd.ComplexTypeDefinitionfrom anotherxsd.SimpleTypeDefinitionorxsd.ComplexTypeDefinition.Specifying post-schema-validation infoset contributions for
xml.ElementInformationItemobjects.Limiting the ability to derive additional types from a given
xsd.ComplexTypeDefinition.Controlling the permission to substitute, in an instance, elements of a derived type for elements declared in a content model to be of a given complex type.
Base class: xsd.TypeDefinition -> xsd.Component
-
class
xsd.ComplexTypeDefinition¶ Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a
NotImplementedErrorexception.
Attributes¶
-
xsd.ComplexTypeDefinition.abstract¶ Returns True if the
xsd.ComplexTypeDefinitionis abstract, False otherwise.xsd.ComplexTypeDefinitionobjects for which abstract is true have no valid instances and thus cannot be used in the normal way as the type definition for the validation ofxml.ElementInformationItemobjects (if for some reason an abstract type is identified as the governing type definition of anxml.ElementInformationItem, the item will invariably be invalid). It follows that such abstract types must not be referenced from an xsi:type attribute in an instance document. Abstractxsd.ComplexTypeDefinitionobjects can be used as base type definitions, or even as the declared type definitions ofxsd.ElementDeclarationobjects, provided in every case a concrete derived type definition is used for validation, either via xsi:type or the operation of a substitution group.
-
xsd.ComplexTypeDefinition.annotations¶ Returns an iterator of
xsd.Annotationcomponents.
-
xsd.ComplexTypeDefinition.assertions¶ Returns an iterator of
xsd.Assertionschema components. The assertions property constrain elements and attributes to exist, not to exist, or to have specified values. Though specified as a sequence, the order among the Assertions is not significant during assessment.
-
xsd.ComplexTypeDefinition.attribute_uses¶ Returns an iterator of
xsd.AttributeUseschema components. The attribute_uses and attribute_wildcard properties specifiy whichxml.AttributeInformationItemobjects are permitted onxml.ElementInformationItemobjects validated by thisxsd.ComplexTypeDefinition.
-
xsd.ComplexTypeDefinition.attribute_wildcard¶ Returns an
xsd.AnyAttributeschema component, or None if no attribute wildcard is specified for thisxsd.ComplexTypeDefinition. Attribute wildcards provide a more flexible specification for validation of attributes not explicitly included in attribute_uses.
-
xsd.ComplexTypeDefinition.base_type_definition¶ Returns the base type definition of this
xsd.ComplexTypeDefinition. Eachxsd.ComplexTypeDefinitionis derived from a base type definition which is itself either axsd.SimpleTypeDefinitionor axsd.ComplexTypeDefinition.
-
xsd.ComplexTypeDefinition.content_type¶ Returns the
xsd.ContentTypeproperty record for thisxsd.ComplexTypeDefinition.The
xsd.ContentTypedetermines the validation of children ofxml.ElementInformationItemobjects.A
xsd.ContentTypewith varietyxsd.ContentTypeVariety.EMPTYvalidates elements with noxml.CharDataInformationItem
or
xml.ElementInformationItemchildren.A
xsd.ContentTypewith varietyxsd.ContentTypeVariety.SIMPLEvalidates elements with character-only children
using its
xsd.SimpleTypeDefinition.A
xsd.ContentTypewith varietyxsd.ContentTypeVariety.ELEMENT_ONLYvalidates elements with children that
conform to the content model supplied by its
xsd.Particle.A
xsd.ContentTypewith varietyxsd.ContentTypeVariety.MIXEDvalidates elements whose element children
(i.e. specifically ignoring other children such as xml.CharDataIinformationItem objects) conform to the content model supplied by its
xsd.Particle.A
xsd.ContentTypewithxsd.ContentType.open_content!= None validates elements with some children conforming to the content model
and others conforming to the
xsd.OpenContent.
-
xsd.ComplexTypeDefinition.context¶ Returns the context of this
xsd.ComplexTypeDefinition. Required if name is absent, otherwise must be None. Either anxsd.ElementDeclarationor axsd.ComplexTypeDefinition.
-
xsd.ComplexTypeDefinition.derivation_method¶ Returns the means of derivation of this
xsd.ComplexTypeDefinition. This is eitherxsd.DerivationMethod.EXTENSIONorxsd.DerivationMethod.RESTRICTION.
-
xsd.Component.element Returns the
xml.ElementInformationItemrepresenting this schema component.
-
xsd.ComplexTypeDefinition.final¶ Returns a subset of {
xsd.FinalValue.EXTENSION,xsd.FinalValue.RESTRICTION}. Axsd.ComplexTypeDefinitionwith an empty specification for final can be used as a base type definition for other types derived by either of extension or restriction; the explicit valuesxsd.FinalValue.EXTENSION, andxsd.FinalValue.RESTRICTIONprevent further derivations by extension and restriction respectively.
-
xsd.Component.id Returns the value of the ‘id’ attribute as a string, or None if the schema component’s XML element doesn’t have an ‘id’ attribute.
-
xsd.ComplexTypeDefinition.name¶ Returns the name of the
xsd.ComplexTypeDefinition.
-
xsd.ComplexTypeDefinition.prohibited_substitutions¶ Returns a subset of {
xsd.BlockValue.EXTENSION,xsd.BlockValue.RESTRICTION}. Thexsd.ComplexTypeDefinition.prohibited_substitutionsproperty of axsd.ComplexTypeDefinitionT determines whether type definitions derived from T are or are not validly substitutable for T.If prohibited_substitutions contains
xsd.BlockValue.RESTRICTION, then no type definition is validly substitutable
for T if its derivation from T involves any restriction steps.
If prohibited_substitutions contains
xsd.BlockValue.EXTENSION, then no type definition is validly substitutable for
T if its derivation from T involves any extension steps.
-
xsd.ComplexTypeDefinition.qname¶ Returns a
xml.QNameobject representing the name and target_namespace pair of the component.
-
xsd.ComplexTypeDefinition.target_namespace¶ Returns the target namespace of the
xsd.ComplexTypeDefinition.
Methods¶
-
xsd.TypeDefinition.is_derived_from(TypeDefinition typeDef) Returns True if this
xsd.TypeDefinitionis derived from other, False otherwise.
Special methods¶
__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__