xsd.SimpleTypeDefinition
¶
xsd.SimpleTypeDefinition
objects provide for constraining the values of xml.AttributeInformationItem objects as well as the xml.CharDataInformationItem children of xml.ElementInformationItem objects.
Base class: xsd.TypeDefinition
-> xsd.Component
- class xsd.SimpleTypeDefinition¶
Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a
NotImplementedError
exception.
Attributes¶
- xsd.SimpleTypeDefinition.annotations¶
Returns an iterator of
xsd.Annotation
components.
- xsd.SimpleTypeDefinition.base_type_definition¶
Returns the type definition this
xsd.SimpleTypeDefinition
is derived from. With one exception, the base_type_definition of anyxsd.SimpleTypeDefinition
is axsd.SimpleTypeDefinition
. The exception is xs:anySimpleType, which has xs:anyType, axsd.ComplexTypeDefinition
, as its base_type_definition.
- xsd.SimpleTypeDefinition.context¶
Returns the context schema component (either an
xsd.AttributeDeclaration
, anxsd.ElementDeclaration
, axsd.ComplexTypeDefinition
or axsd.SimpleTypeDefinition
) of thisxsd.SimpleTypeDefinition
, or None if thisxsd.SimpleTypeDefinition
is a global type defintion (i.e. name is not None).
- xsd.Component.element
Returns the xml.ElementInformationItem representing this schema component.
- xsd.SimpleTypeDefinition.facets¶
Returns an iterator of
xsd.Facet
schema components. These xsd.Facets specify constraints on the datatype described by thexsd.SimpleTypeDefinition
. For atomic definitions, these are restricted to those appropriate for the corresponding primitive_type_definition. Therefore, the value space and lexical space (i.e. what is validated by any atomic simple type) is determined by the pair (primitive_type_definition, facets).
- xsd.SimpleTypeDefinition.final¶
Returns a subset of {
xsd.FinalValue.EXTENSION
,xsd.FinalValue.RESTRICTION
,xsd.FinalValue.LIST
,xsd.FinalValue.UNION
}. Axsd.SimpleTypeDefinition
with an empty specification for final can be used as the base_type_definition for other types derived by either of extension or restriction, or as the item_type_definition in the definition of a list, or in the member_type_definitions of a union; the explicit valuesxsd.FinalValue.EXTENSION
,xsd.FinalValue.RESTRICTION
,xsd.FinalValue.LIST
andxsd.FinalValue.UNION
prevent further derivations by extension (to yield a complex type) and restriction (to yield a simple type) and use in constructing lists and unions 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.SimpleTypeDefinition.item_type_definition¶
Returns a
xsd.SimpleTypeDefinition
if variety isxsd.SimpleTypeVariety.LIST
, or None otherwise. The value of this property must be a primitive or ordinaryxsd.SimpleTypeDefinition
with variety ==xsd.SimpleTypeVariety.ATOMIC
, or an ordinaryxsd.SimpleTypeDefinition
with variety ==xsd.SimpleTypeVariety.UNION
whose basic members are all atomic; the value must not itself be a list type or have any basic members which are list types.
- xsd.SimpleTypeDefinition.member_type_definitions¶
Returns an iterator of
xsd.SimpleTypeDefinition
components if variety isxsd.SimpleTypeVariety.UNION
, or None otherwise. This may contain any primitive or ordinaryxsd.SimpleTypeDefinition
, but must not contain any special type definitions (i.e. xs:anySimpleType or xs:anyAtomicType).
- xsd.SimpleTypeDefinition.name¶
Returns the name of the
xsd.SimpleTypeDefinition
, or None for anonymous (local)xsd.SimpleTypeDefinition
objects.
- xsd.SimpleTypeDefinition.primitive_type_definition¶
Returns a
xsd.SimpleTypeDefinition
if variety isxsd.SimpleTypeVariety.ATOMIC
(except for xs:anyAtomicType), or None otherwise. The primitive type definitions are:xsd.string
- represents character strings in XML.xsd.boolean
- represents the values of two-valued logic.xsd.decimal
- represents the subset of the real numbers, which can be represented by decimal numerals.xsd.float
- represents single-precision 32-bit floating point numbers.xsd.double
- represents double-precision 64-bit floating point numbers.xsd.duration
- represents durations of time.xsd.dateTime
- represents instants of time.xsd.time
- represents instants of time that recur at the same point in each calendar day, or that occur in some arbitrary calendar day.xsd.date
- represents top-open intervals of exactly one day in length on the timelines of xs:dateTime, beginning on the beginning moment of each day, up to but not including the beginning moment of the next day).xsd.gYearMonth
- represents specific whole Gregorian months in specific Gregorian years.xsd.gYear
- represents Gregorian calendar years.xsd.gMonthDay
- represents whole calendar days that recur at the same point in each calendar year, or that occur in some arbitrary calendar year.xsd.gDay
- represents whole days within an arbitrary month.xsd.gMonth
- represents whole months within an arbitrary year.xsd.hexBinary
- represents arbitrary hex-encoded binary data.xsd.base64Binary
- represents arbitrary Base64-encoded binary data.xsd.anyURI
- represents an Internationalized Resource Identifier Reference (IRI).xsd.QName
- represents XML qualified names.xsd.NOTATION
- represents the NOTATION attribute type from XML.
- xsd.SimpleTypeDefinition.qname¶
Returns a xml.QName object representing the name and target_namespace pair of the component.
- xsd.SimpleTypeDefinition.target_namespace¶
Returns the target namespace of the
xsd.SimpleTypeDefinition
.
- xsd.SimpleTypeDefinition.variety¶
Returns one of {
xsd.SimpleTypeVariety.ATOMIC
,xsd.SimpleTypeVariety.LIST
,xsd.SimpleTypeVariety.UNION
}, or None for xs:anySimpleType.
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__