xsd.ComplexTypeDefinition
¶
xsd.ComplexTypeDefinition
objects provide for:
Constraining
xml.ElementInformationItem
objects by providingxsd.AttributeDeclaration
objects 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 thexml.CharDataInformationItem
children to conform to a specifiedxsd.SimpleTypeDefinition
.Constraining elements and attributes to exist, not to exist, or to have specified values, with
xsd.Assertion
objects.Using the mechanisms of Type Definition Hierarchy to derive a
xsd.ComplexTypeDefinition
from anotherxsd.SimpleTypeDefinition
orxsd.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
NotImplementedError
exception.
Attributes¶
-
xsd.ComplexTypeDefinition.
abstract
¶ Returns True if the
xsd.ComplexTypeDefinition
is abstract, False otherwise.xsd.ComplexTypeDefinition
objects 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.ElementInformationItem
objects (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.ComplexTypeDefinition
objects can be used as base type definitions, or even as the declared type definitions ofxsd.ElementDeclaration
objects, 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.Annotation
components.
-
xsd.ComplexTypeDefinition.
assertions
¶ Returns an iterator of
xsd.Assertion
schema 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.AttributeUse
schema components. The attribute_uses and attribute_wildcard properties specifiy whichxml.AttributeInformationItem
objects are permitted onxml.ElementInformationItem
objects validated by thisxsd.ComplexTypeDefinition
.
-
xsd.ComplexTypeDefinition.
attribute_wildcard
¶ Returns an
xsd.AnyAttribute
schema 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.ComplexTypeDefinition
is derived from a base type definition which is itself either axsd.SimpleTypeDefinition
or axsd.ComplexTypeDefinition
.
-
xsd.ComplexTypeDefinition.
content_type
¶ Returns the
xsd.ContentType
property record for thisxsd.ComplexTypeDefinition
.The
xsd.ContentType
determines the validation of children ofxml.ElementInformationItem
objects.A
xsd.ContentType
with varietyxsd.ContentTypeVariety.EMPTY
validates elements with noxml.CharDataInformationItem
or
xml.ElementInformationItem
children.A
xsd.ContentType
with varietyxsd.ContentTypeVariety.SIMPLE
validates elements with character-only children
using its
xsd.SimpleTypeDefinition
.A
xsd.ContentType
with varietyxsd.ContentTypeVariety.ELEMENT_ONLY
validates elements with children that
conform to the content model supplied by its
xsd.Particle
.A
xsd.ContentType
with varietyxsd.ContentTypeVariety.MIXED
validates 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.ContentType
withxsd.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.ElementDeclaration
or axsd.ComplexTypeDefinition
.
-
xsd.ComplexTypeDefinition.
derivation_method
¶ Returns the means of derivation of this
xsd.ComplexTypeDefinition
. This is eitherxsd.DerivationMethod.EXTENSION
orxsd.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
}. Axsd.ComplexTypeDefinition
with 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.RESTRICTION
prevent 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_substitutions
property of axsd.ComplexTypeDefinition
T 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.TypeDefinition
is derived from other, False otherwise.
Special methods¶
__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__