Package pyxb :: Package binding :: Module datatypes
[hide private]
[frames] | no frames]

Module datatypes

source code

Classes supporting XMLSchema Part 2: Datatypes.

Each simple type definition component instance is paired with at most one basis.simpleTypeDefinition class, which is a subclass of a Python type augmented with facets and other constraining information. This file contains the definitions of these types.

We want the simple datatypes to be efficient Python values, but to also hold specific constraints that don't apply to the Python types. To do this, we subclass each PST. Primitive PSTs inherit from the Python type that represents them, and from a pyxb.binding.basis.simpleTypeDefinition class which adds in the constraint infrastructure. Derived PSTs inherit from the parent PST.

There is an exception to this when the Python type best suited for a derived SimpleTypeDefinition differs from the type associated with its parent STD: for example, xsd:integer has a value range that requires it be represented by a Python long, but xsd:int allows representation by a Python int. In this case, the derived PST class is structured like a primitive type, but the PST associated with the STD superclass is recorded in a class variable _XsdBaseType.

Note the strict terminology: "datatype" refers to a class which is a subclass of a Python type, while "type definition" refers to an instance of either SimpleTypeDefinition or ComplexTypeDefinition.

Classes [hide private]
  anySimpleType
See http://www.w3.org/TR/xmlschema-2/#dt-anySimpleType
  string
string.
  boolean
boolean.
  decimal
decimal.
  float
float.
  double
double.
  duration
http://www.w3.org/TR/xmlschema-2/#duration
  _PyXBDateTime_base
  _PyXBDateTimeZone_base
  dateTime
http://www.w3.org/TR/xmlschema-2/index.html#dateTime
  time
http://www.w3.org/TR/xmlschema-2/index.html#time
  _PyXBDateOnly_base
  date
http://www.w3.org/TR/xmlschema-2/index.html#date
  gYearMonth
http://www.w3.org/TR/xmlschema-2/index.html#gYearMonth
  gYear
http://www.w3.org/TR/xmlschema-2/index.html#gYear
  gMonthDay
http://www.w3.org/TR/xmlschema-2/index.html#gMonthDay
  gDay
http://www.w3.org/TR/xmlschema-2/index.html#gDay
  gMonth
http://www.w3.org/TR/xmlschema-2/index.html#gMonth
  hexBinary
  base64Binary
  anyURI
  QName
  NOTATION
  normalizedString
See http:///www.w3.org/TR/xmlschema-2/index.html#normalizedString
  token
See http:///www.w3.org/TR/xmlschema-2/index.html#token
  language
See http:///www.w3.org/TR/xmlschema-2/index.html#language
  NMTOKEN
See http://www.w3.org/TR/2000/WD-xml-2e-20000814.html#NT-Nmtoken
  NMTOKENS
  Name
See http://www.w3.org/TR/2000/WD-xml-2e-20000814.html#NT-Name
  NCName
See http://www.w3.org/TR/1999/REC-xml-names-19990114/index.html#NT-NCName
  ID
  IDREF
  IDREFS
  ENTITY
  ENTITIES
  integer
integer.
  nonPositiveInteger
  negativeInteger
  long
  int
  short
  byte
  nonNegativeInteger
  unsignedLong
  unsignedInt
  unsignedShort
  unsignedByte
  positiveInteger
  anyType
http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-urType
Variables [hide private]
  _PrimitiveDatatypes = [<class 'pyxb.binding.datatypes.string'>...
  _DerivedDatatypes = [<class 'pyxb.binding.datatypes.normalized...
  _ListDatatypes = [<class 'pyxb.binding.datatypes.NMTOKENS'>, <...
Variables Details [hide private]

_PrimitiveDatatypes

Value:
[<class 'pyxb.binding.datatypes.string'>,
 <class 'pyxb.binding.datatypes.boolean'>,
 <class 'pyxb.binding.datatypes.decimal'>,
 <class 'pyxb.binding.datatypes.float'>,
 <class 'pyxb.binding.datatypes.double'>,
 <class 'pyxb.binding.datatypes.duration'>,
 <class 'pyxb.binding.datatypes.dateTime'>,
 <class 'pyxb.binding.datatypes.time'>,
...

_DerivedDatatypes

Value:
[<class 'pyxb.binding.datatypes.normalizedString'>,
 <class 'pyxb.binding.datatypes.token'>,
 <class 'pyxb.binding.datatypes.language'>,
 <class 'pyxb.binding.datatypes.NMTOKEN'>,
 <class 'pyxb.binding.datatypes.Name'>,
 <class 'pyxb.binding.datatypes.NCName'>,
 <class 'pyxb.binding.datatypes.ID'>,
 <class 'pyxb.binding.datatypes.IDREF'>,
...

_ListDatatypes

Value:
[<class 'pyxb.binding.datatypes.NMTOKENS'>,
 <class 'pyxb.binding.datatypes.IDREFS'>,
 <class 'pyxb.binding.datatypes.ENTITIES'>]