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.
_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'>]
|
|