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
NotImplementedErrorexception.
Attributes¶
- xsd.AttributeDeclaration.annotations¶
Returns an iterator of
xsd.Annotationcomponents.
- 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.AttributeUsebut with thisxsd.AttributeDeclarationas their governingxsd.AttributeDeclarationare 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.ScopeProperty Record of thisxsd.AttributeDeclaration. This defines the scope of thisxsd.AttributeDeclaration. If scope.variety ==xsd.ScopeVariety.GLOBAL, then thisxsd.AttributeDeclarationis 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.ComplexTypeDefinitionor anxsd.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.SimpleTypeDefinitionof thisxsd.AttributeDeclaration. The value of each attribute validated must conform to thisxsd.SimpleTypeDefinition.
- xsd.AttributeDeclaration.value_constraint¶
Returns the
xsd.ValueConstraintProperty Record of thisxsd.AttributeDeclaration. It reproduces the functions of XML default and #FIXED attribute values. A variety ofxsd.ValueConstraintVariety.DEFAULTspecifies 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.FIXEDindicates that the attribute value if present must be equal or identical to value, and if absent receives value and lexical_form as forxsd.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__