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.



Returns an iterator of xsd.Annotation components.


Returns the type definition this xsd.SimpleTypeDefinition is derived from. With one exception, the base_type_definition of any xsd.SimpleTypeDefinition is a xsd.SimpleTypeDefinition. The exception is xs:anySimpleType, which has xs:anyType, a xsd.ComplexTypeDefinition, as its base_type_definition.


Returns the context schema component (either an xsd.AttributeDeclaration, an xsd.ElementDeclaration, a xsd.ComplexTypeDefinition or a xsd.SimpleTypeDefinition) of this xsd.SimpleTypeDefinition, or None if this xsd.SimpleTypeDefinition is a global type defintion (i.e. name is not None).


Returns the xml.ElementInformationItem representing this schema component.


Returns an iterator of xsd.Facet schema components. These xsd.Facets specify constraints on the datatype described by the xsd.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).


Returns a subset of {xsd.FinalValue.EXTENSION, xsd.FinalValue.RESTRICTION, xsd.FinalValue.LIST, xsd.FinalValue.UNION}. A xsd.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 values xsd.FinalValue.EXTENSION, xsd.FinalValue.RESTRICTION, xsd.FinalValue.LIST and xsd.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.


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 a xsd.SimpleTypeDefinition if variety is xsd.SimpleTypeVariety.LIST, or None otherwise. The value of this property must be a primitive or ordinary xsd.SimpleTypeDefinition with variety == xsd.SimpleTypeVariety.ATOMIC, or an ordinary xsd.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.


Returns an iterator of xsd.SimpleTypeDefinition components if variety is xsd.SimpleTypeVariety.UNION, or None otherwise. This may contain any primitive or ordinary xsd.SimpleTypeDefinition, but must not contain any special type definitions (i.e. xs:anySimpleType or xs:anyAtomicType).


Returns the name of the xsd.SimpleTypeDefinition, or None for anonymous (local) xsd.SimpleTypeDefinition objects.


Returns a xsd.SimpleTypeDefinition if variety is xsd.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.


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


Returns the target namespace of the xsd.SimpleTypeDefinition.


Returns one of {xsd.SimpleTypeVariety.ATOMIC, xsd.SimpleTypeVariety.LIST, xsd.SimpleTypeVariety.UNION}, or None for xs:anySimpleType.


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__