xsd.ElementDeclaration
¶
xsd.ElementDeclaration
objects provide for local validation of xml.ElementInformationItem values using a type definition;
Specifying default or fixed values for xml.ElementInformationItem objects;
Establishing uniquenesses and reference constraint relationships among the values of related elements and attributes;
Controlling the substitutability of elements through the mechanism of element substitution groups.
Base class: xsd.Component
- class xsd.ElementDeclaration¶
Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a
NotImplementedError
exception.
Attributes¶
- xsd.ElementDeclaration.abstract¶
Returns True if this
xsd.ElementDeclaration
is abstract. Suchxsd.ElementDeclaration
objects can appear in content models only when substitution is allowed; such declarations must not themselves ever be used to validate element content.
- xsd.ElementDeclaration.annotations¶
Returns an iterator of
xsd.Annotation
components.
- xsd.ElementDeclaration.disallowed_substitutions¶
Returns a subset of {
xsd.BlockValue.EXTENSION
,xsd.BlockValue.RESTRICTION
,xsd.BlockValue.SUBSTITUTION
}. The supplied values for disallowed_substitutions determine whether anxsd.ElementDeclaration
appearing in a content model will be prevented from additionally validating elements (a) with an xsi:type that identifies an extension or restriction of the type of the declared element, and/or (b) from validating elements which are in the substitution group headed by the declared element. If disallowed_substitutions is empty, then all derived types and substitution group members are allowed.
- xsd.Component.element
Returns the xml.ElementInformationItem representing this schema component.
- 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.ElementDeclaration.identity_constraint_definitions¶
Returns an iterator of
xsd.IdentityConstraintDefinition
objects, which express constraints establishing uniquenesses and reference relationships among the values of related elements and attributes.
- xsd.ElementDeclaration.name¶
Returns the name of the
xsd.ElementDeclaration
. This property must match the local part of the names of elements being validated.
- xsd.ElementDeclaration.nillable¶
If nillable is True, then an element with no text or element content can be valid despite a type definition which would otherwise require content, if it carries the attribute xsi:nil with the value true.
- xsd.ElementDeclaration.qname¶
Returns a xml.QName object representing the name and target_namespace pair of the component.
- xsd.ElementDeclaration.scope¶
Returns the
xsd.Scope
property record of thisxsd.ElementDeclaration
. If scope.variety ==xsd.ScopeVariety.GLOBAL
, then thisxsd.ElementDeclaration
is available for use throughout thexsd.Schema
. If scope.variety ==xsd.ScopeVariety.LOCAL
, then this declaration is available for use only within scope.parent (which is axsd.ComplexTypeDefinition
or axsd.ModelGroupDefinition
).
- xsd.ElementDeclaration.substitution_group_affiliations¶
Returns an iterator of
xsd.ElementDeclaration
objects indicating the substitution groups thisxsd.ElementDeclaration
can potentially be a member of. Potential membership is transitive but not symmetric; anxsd.ElementDeclaration
is a potential member of any group named in its substitution_group_affiliations, and also of any group of which any entry in its substitution_group_affiliations is a potential member. Actual membership may be blocked by the effects of substitution_group_exclusions or disallowed_substitutions.
- xsd.ElementDeclaration.substitution_group_exclusions¶
Returns a subset of {
xsd.FinalValue.EXTENSION
,xsd.FinalValue.RESTRICTION
}. An empty substitution_group_exclusions allows a declaration to be named in the substitution_group_affiliations of otherxsd.ElementDeclaration
objects having the same declared type definition or some type derived therefrom. The explicit values of substitution_group_exclusions,xsd.FinalValue.EXTENSION
orxsd.FinalValue.RESTRICTION
, rule outxsd.ElementDeclaration
objects having types whose derivation from type_definition involves any extension steps, or restriction steps, respectively.
- xsd.ElementDeclaration.substitution_group_members¶
Returns an iterator of the actual members of this
xsd.ElementDeclaration
’s substitution group.
- xsd.ElementDeclaration.target_namespace¶
Returns the target namespace of the
xsd.ElementDeclaration
. A non-absent value provides for validation of namespace-qualified xml.ElementInformationItem objects. Absent values of target_namespace validate unqualified items.
- xsd.ElementDeclaration.type_definition¶
Returns the declared type definition of this
xsd.ElementDeclaration
. This can either be axsd.ComplexTypeDefinition
or axsd.SimpleTypeDefinition
. The type definition against which an element information item is validated (its governing type definition) can be different from the declared type definition. Thexsd.ElementDeclaration.type_table
property, which governs conditional type assignment, and the xsi:type attribute of an xml.ElementInformationItem can cause the governing type definition and the declared type definition to be different.
- xsd.ElementDeclaration.type_table¶
Returns the
xsd.TypeTable
property record of thisxsd.ElementDeclaration
. This property record governs conditional type assignment usingxsd.TypeAlternative
schema components.
- xsd.ElementDeclaration.value_constraint¶
Returns the
xsd.ValueConstraint
property record of thisxsd.ElementDeclaration
. This property establishes a default or fixed value for an element. If axsd.ValueConstraint
with variety ==xsd.ValueConstraintVariety.DEFAULT
is present, and if the element being validated is empty, then for purposes of calculating the schema normalized value and other contributions to the post-schema-validation infoset the element is treated as ifxsd.ValueConstraint.lexical_form
was used as the content of the element. If variety ==xsd.ValueConstraintVariety.FIXED
, then the element’s content must either be empty, in which case FIXED behaves as DEFAULT, or its value must be equal or identical toxsd.ValueConstraint.value
.
Special methods¶
__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__