xsd.ComplexTypeDefinition¶
xsd.ComplexTypeDefinition objects provide for:
Constraining xml.ElementInformationItem objects by providing
xsd.AttributeDeclarationobjects governing the appearance and content of attributes.
Constraining xml.ElementInformationItem children to be empty, or to conform to a specified element-only or mixed content model, or else constraining the xml.CharDataInformationItem children to conform to a specified
xsd.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.ElementInformationItem objects.
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 of xml.ElementInformationItem objects (if for some reason an abstract type is identified as the governing type definition of an xml.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. Abstract- xsd.ComplexTypeDefinitionobjects can be used as base type definitions, or even as the declared type definitions of- xsd.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 which xml.AttributeInformationItem objects are permitted on xml.ElementInformationItem objects validated by this- xsd.ComplexTypeDefinition.
- xsd.ComplexTypeDefinition.attribute_wildcard¶
- Returns an - xsd.AnyAttributeschema component, or None if no attribute wildcard is specified for this- xsd.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. Each- xsd.ComplexTypeDefinitionis derived from a base type definition which is itself either a- xsd.SimpleTypeDefinitionor a- xsd.ComplexTypeDefinition.
- xsd.ComplexTypeDefinition.content_type¶
- Returns the - xsd.ContentTypeproperty record for this- xsd.ComplexTypeDefinition.- The - xsd.ContentTypedetermines the validation of children of xml.ElementInformationItem objects.- A - xsd.ContentTypewith variety- xsd.ContentTypeVariety.EMPTYvalidates elements with no xml.CharDataInformationItem
 - or xml.ElementInformationItem children. - A - xsd.ContentTypewith variety- xsd.ContentTypeVariety.SIMPLEvalidates elements with character-only children
 - using its - xsd.SimpleTypeDefinition.- A - xsd.ContentTypewith variety- xsd.ContentTypeVariety.ELEMENT_ONLYvalidates elements with children that
 - conform to the content model supplied by its - xsd.Particle.- A - xsd.ContentTypewith variety- xsd.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.ContentTypewith- xsd.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 an- xsd.ElementDeclarationor a- xsd.ComplexTypeDefinition.
- xsd.ComplexTypeDefinition.derivation_method¶
- Returns the means of derivation of this - xsd.ComplexTypeDefinition. This is either- xsd.DerivationMethod.EXTENSIONor- xsd.DerivationMethod.RESTRICTION.
- xsd.Component.element
- Returns the xml.ElementInformationItem representing this schema component. 
- xsd.ComplexTypeDefinition.final¶
- Returns a subset of { - xsd.FinalValue.EXTENSION,- xsd.FinalValue.RESTRICTION}. A- xsd.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 values- xsd.FinalValue.EXTENSION, and- xsd.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}. The- xsd.ComplexTypeDefinition.prohibited_substitutionsproperty of a- xsd.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.QName object 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__
