xsd.AttributeDeclaration

xsd.AttributeDeclaration objects provide for local validation of xml.AttributeInformationItem values using a xsd.SimpleTypeDefinition and specifying default or fixed values for xml.AttributeInformationItem objects.

Base class: xsd.Component

class xsd.AttributeDeclaration

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

Attributes

xsd.AttributeDeclaration.annotations

Returns an iterator of xsd.Annotation components.

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.AttributeDeclaration.inheritable

Returns True if xml.AttributeInformationItem objects not attributed to any xsd.AttributeUse but with this xsd.AttributeDeclaration as their governing xsd.AttributeDeclaration are potentially inherited by descendant xml.ElementInformationItem objects, False otherwise.

xsd.AttributeDeclaration.name

Returns the name of the xsd.AttributeDeclaration. This must match the local part of the names of attributes being validated.

xsd.AttributeDeclaration.qname

Returns a xml.QName object representing the name and target_namespace pair of the component.

xsd.AttributeDeclaration.scope

Returns the xsd.Scope Property Record of this xsd.AttributeDeclaration. This defines the scope of this xsd.AttributeDeclaration. If scope.variety == xsd.ScopeVariety.GLOBAL, then this xsd.AttributeDeclaration is available for use throughout the xsd.Schema. If scope.variety == xsd.ScopeVariety.LOCAL, then this declaration is available for use only within scope.parent (which is a xsd.ComplexTypeDefinition or an xsd.AttributeGroupDefinition).

xsd.AttributeDeclaration.target_namespace

Returns the target namespace of the xsd.AttributeDeclaration. A non-absent value of provides for validation of namespace-qualified xml.AttributeInformationItem objects (which must be explicitly prefixed in the character-level form of XML documents). Absent values of target_namespace validate unqualified (unprefixed) xml.AttributeInformationItem objects.

xsd.AttributeDeclaration.type_definition

Returns the xsd.SimpleTypeDefinition of this xsd.AttributeDeclaration. The value of each attribute validated must conform to this xsd.SimpleTypeDefinition.

xsd.AttributeDeclaration.value_constraint

Returns the xsd.ValueConstraint Property Record of this xsd.AttributeDeclaration. It reproduces the functions of XML default and #FIXED attribute values. A variety of xsd.ValueConstraintVariety.DEFAULT specifies that the attribute is to appear unconditionally in the post-schema-validation infoset, with value and lexical_form used whenever the attribute is not actually present; xsd.ValueConstraintVariety.FIXED indicates that the attribute value if present must be equal or identical to value, and if absent receives value and lexical_form as for xsd.ValueConstraintVariety.DEFAULT. Note that it is values that are checked, not strings, and that the test is for either equality or identity.

Special methods

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