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.



Returns an iterator of xsd.Annotation components.


Returns the xml.ElementInformationItem representing this schema component.


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.


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.


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


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


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).


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.


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


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__