pyxb.binding package

Submodules

pyxb.binding.basis module

This module contains support classes from which schema-specific bindings inherit, and that describe the content models of those schema.

class pyxb.binding.basis.ElementContent(value, element_declaration=None, instance=None, tag=None)

Bases: pyxb.binding.basis._Content

Marking wrapper for element content.

The value should be translated into XML and made a child of its parent.

_ElementContent__elementDeclaration = None
_ElementContent__getElementDeclaration()

The pyxb.binding.content.ElementDeclaration associated with the element content. This may be None if the value is a wildcard.

elementDeclaration

The pyxb.binding.content.ElementDeclaration associated with the element content. This may be None if the value is a wildcard.

class pyxb.binding.basis.NonElementContent(value)

Bases: pyxb.binding.basis._Content

Marking wrapper for non-element content.

The value will be unicode text, and should be appended as character data.

class pyxb.binding.basis.STD_list(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, list

Base class for collection datatypes.

This class descends from the Python list type, and incorporates simpleTypeDefinition. Subclasses must define a class variable _ItemType which is a reference to the class of which members must be instances.

classmethod XsdLiteral(value)

Convert from a binding value to a string usable in an XML document.

classmethod _ConvertArguments_vx(args, kw)
_ItemType = None

A reference to the binding class for items within this list.

classmethod _STD_list__ConvertOne(v)
_STD_list__FacetMap = {}
_STD_list__convertMany(values)
classmethod _ValidatedItem(value, kw=None)

Verify that the given value is permitted as an item of this list.

This may convert the value to the proper type, if it is compatible but not an instance of the item type. Returns the value that should be used as the item, or raises an exception if the value cannot be converted.

Parameters:kw – optional dictionary of standard constructor keywords used

when exceptions must be built. In particular, _location may be useful.

classmethod _XsdValueLength_vx(value)
classmethod _description(name_only=False, user_documentation=True)
append(x)
count(x)
extend(x, _from_xml=False)
index(x, *args)
insert(i, x)
remove(x)
class pyxb.binding.basis.STD_union(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition

Base class for union datatypes.

This class descends only from simpleTypeDefinition. A pyxb.LogicError is raised if an attempt is made to construct an instance of a subclass of STD_union. Values consistent with the member types are constructed using the Factory class method. Values are validated using the _ValidatedMember class method.

Subclasses must provide a class variable _MemberTypes which is a tuple of legal members of the union.

classmethod Factory(*args, **kw)

Given a value, attempt to create an instance of some member of this union. The first instance which can be legally created is returned.

Parameters:_validate_constraints – If True (default if validation is

enabled), any constructed value is checked against constraints applied to the union as well as the member type.

Raises:pyxb.SimpleTypeValueError – no member type will permit creation of

an instance from the parameters in args and kw.

classmethod XsdLiteral(value)

Convert from a binding value to a string usable in an XML document.

_MemberTypes = None

A list of classes which are permitted as values of the union.

_STD_union__FacetMap = {}
classmethod _ValidatedMember(value)

Validate the given value as a potential union member.

Raises:pyxb.SimpleTypeValueError – the value is not an instance of a

member type.

classmethod _description(name_only=False, user_documentation=True)
class pyxb.binding.basis._Content(value)

Bases: object

Base for any wrapper added to complexTypeDefinition.orderedContent.

classmethod ContentIterator(input)

Return an iterator that filters and maps a sequence of _Content instances.

The returned iterator will filter out sequence members that are not instances of the class from which the iterator was created. Further, only the value field of the sequence member is returned.

Thus the catenated text of the non-element content of an instance can be obtained with:

text = six.u('').join(NonElementContent.ContentIterator(instance.orderedContent()))

See also pyxb.NonElementContent

_Content__getValue()

The value of the content.

This is a unicode string for NonElementContent, and (ideally) an instance of _TypeBinding_mixin for ElementContent.

_Content__value = None
value

The value of the content.

This is a unicode string for NonElementContent, and (ideally) an instance of _TypeBinding_mixin for ElementContent.

class pyxb.binding.basis._DynamicCreate_mixin(*args, **kw)

Bases: pyxb.cscRoot

Helper to allow overriding the implementation class.

Generally we’ll want to augment the generated bindings by subclassing them, and adding functionality to the subclass. This mix-in provides a way to communicate the existence of the superseding subclass back to the binding infrastructure, so that when it creates an instance it uses the subclass rather than the unaugmented binding class.

When a raw generated binding is subclassed, _SetSupersedingClass should be invoked on the raw class passing in the superseding subclass. E.g.:

class mywsdl (raw.wsdl):
  pass
raw.wsdl._SetSupersedingClass(mywsdl)
classmethod _AlternativeConstructor()

Return the class stored in the class reference attribute.

classmethod _DynamicCreate(*args, **kw)

Invoke the constructor for this class or the one that supersedes it.

classmethod _DynamicCreate_mixin__AlternativeConstructorAttribute()
classmethod _DynamicCreate_mixin__SupersedingClassAttribute()
classmethod _SetAlternativeConstructor(alternative_constructor)
classmethod _SetSupersedingClass(superseding)

Set the class reference attribute.

Parameters:superseding – A Python class that is a subclass of this class.
classmethod _SupersedingClass()

Return the class stored in the class reference attribute.

class pyxb.binding.basis._NoNullaryNonNillableNew_mixin(*args, **kw)

Bases: pyxb.cscRoot

Marker class indicating that a simple data type cannot construct a value from XML through an empty string.

This class should appear immediately simpleTypeDefinition (or whatever inherits from simpleTypeDefinition in cases where it applies.

class pyxb.binding.basis._RepresentAsXsdLiteral_mixin(*args, **kw)

Bases: pyxb.cscRoot

Marker class for data types using XSD literal string as pythonLiteral.

This is necessary for any simple data type where Python repr() produces a constructor call involving a class that may not be available by that name; e.g. duration, decimal, and any of the date/time types.

class pyxb.binding.basis._TypeBinding_mixin(*args, **kw)

Bases: pyxb.utils.utility.Locatable_mixin

classmethod Factory(*args, **kw)

Provide a common mechanism to create new instances of this type.

The class constructor won’t do, because you can’t create instances of union types.

This method may be overridden in subclasses (like STD_union). Pre- and post-creation actions can be customized on a per-class instance by overriding the _PreFactory_vx and _postFactory_vx methods.

Parameters:_dom_node – If provided, the value must be a DOM node, the

content of which will be used to set the value of the instance.

Parameters:_location – An optional instance of

pyxb.utils.utility.Location showing the origin the binding. If None, a value from _dom_node is used if available.

Parameters:_from_xml – If True, the input must be either a DOM node or

a unicode string comprising a lexical representation of a value. This is a further control on _apply_whitespace_facet and arises from cases where the lexical and value representations cannot be distinguished by type. The default value is True iff _dom_node is not None.

Parameters:_apply_whitespace_facet – If True and this is a

simpleTypeDefinition with a whiteSpace facet, the first argument will be normalized in accordance with that facet prior to invoking the parent constructor. The value is always True if text content is extracted from a _dom_node, and otherwise defaults to the defaulted value of _from_xml.

Parameters:_validate_constraints – If True, any constructed value is

checked against constraints applied to the union as well as the member type.

Parameters:_require_value – If False (default), it is permitted to

create a value without an initial value. If True and no initial value was provided, causes pyxb.SimpleContentAbsentError to be raised. Only applies to simpleTypeDefinition instances; this is used when creating values from DOM nodes.

_Abstract = False
_AttributeMap = {}

Map from expanded names to AttributeUse instances. Non-empty only in complexTypeDefinition subclasses.

_AttributeWildcard = None
classmethod _CompatibleValue(value, **kw)

Return a variant of the value that is compatible with this type.

Compatibility is defined relative to the type definition associated with the element. The value None is always compatible. If value has a Python type (e.g., int) that is a superclass of the required _TypeBinding_mixin class (e.g., xs:byte), value is used as a constructor parameter to return a new instance of the required type. Note that constraining facets are applied here if necessary (e.g., although a Python int with value 500 is type-compatible with xs:byte, it is outside the value space, and compatibility will fail).

Parameters:_convert_string_values – If True (default) and the incoming value is

a string, an attempt will be made to form a compatible value by using the string as a constructor argument to the this class. This flag is set to False when testing automaton transitions.

Raises:pyxb.SimpleTypeValueError – if the value is not both

type-consistent and value-consistent with the element’s type.

_ExpandedName = None

The expanded name of the component.

classmethod _GetValidationConfig()

The pyxb.ValidationConfig instance that applies to this class.

By default this will reference pyxb.GlobalValidationConfig.

classmethod _IsSimpleTypeContent()

Return True iff the content of this binding object is a simple type.

This is true only for descendents of simpleTypeDefinition and instances of complexTypeDefinition that have simple type content.

classmethod _IsUrType()

Return True iff this is the ur-type.

The only ur-type is {http://www.w3.org/2001/XMLSchema}anyType. The implementation of this method is overridden for pyxb.binding.datatypes.anyType.

classmethod _Name()

Return the best descriptive name for the type of the instance.

This is intended to be a human-readable value used in diagnostics, and is the expanded name if the type has one, or the Python type name if it does not.

classmethod _PerformValidation()

Determine whether the content model should be validated for this class.

In the absence of context, this returns True iff both binding and document validation are in force.

Deprecated:use _GetValidationConfig and check specific requirements.
classmethod _PreFactory_vx(args, kw)

Method invoked upon entry to the Factory method.

This method is entitled to modify the keywords array. It can also return a state value which is passed to _postFactory_vx.

_PyXBFactoryKeywords = ('_dom_node', '_fallback_namespace', '_from_xml', '_apply_whitespace_facet', '_validate_constraints', '_require_value', '_nil', '_element', '_apply_attributes', '_convert_string_values', '_location')

Keywords that are interpreted by __new__ or __init__ in one or more classes in the PyXB type hierarchy. All these keywords must be removed before invoking base Python __init__ or __new__.

classmethod _RequireXSIType(value_type)
_ReservedSymbols = set(['toDOM', 'property', 'toxml', 'Factory', 'validateBinding'])
classmethod _SetValidationConfig(validation_config)

Set the validation configuration for this class.

classmethod _TypeBinding_mixin__AttributesFromDOM(node)
_TypeBinding_mixin__WarnedUnassociatedElement = False
_TypeBinding_mixin__checkNilCtor(args)
_TypeBinding_mixin__constructedWithValue = False
_TypeBinding_mixin__element = None
_TypeBinding_mixin__getValidationConfig()

The pyxb.ValidationConfig instance that applies to this instance.

By default this will reference the class value from _GetValidationConfig, which defaults to pyxb.GlobalValidationConfig.

_TypeBinding_mixin__namespaceContext = None
_TypeBinding_mixin__xsiNil = None
_XSDLocation = None

Where the definition can be found in the originating schema.

_constructedWithValue()
_diagnosticName()

The best name available for this instance in diagnostics.

If the instance is associated with an element, it is the element name; otherwise it is the best name for the type of the instance per _Name.

_element()

Return a pyxb.binding.basis.element associated with the binding instance.

This will return None unless an element has been associated. Constructing a binding instance using the element instance will add this association.

_finalizeContentModel()

Inform content model that all additions have been provided.

This is used to resolve any pending non-determinism when the content of an element is provided through a DOM assignment or through positional arguments in a constructor.

_isNil()

Indicate whether this instance is U{nil <http://www.w3.org/TR/xmlschema-1/#xsi_nil>}.

The value is set by the DOM and SAX parsers when building an instance from a DOM element with U{xsi:nil <http://www.w3.org/TR/xmlschema-1/#xsi_nil>} set to true.

Returns:None if the element used to create the instance is not

nillable<http://www.w3.org/TR/xmlschema-1/#nillable>. If it is nillable, returns True or False depending on whether the instance itself is nil<http://www.w3.org/TR/xmlschema-1/#xsi_nil>.

_namespaceContext()

Return a namespace context associated with the binding instance.

This will return None unless something has provided a context to the instance. Context is provided when instances are generated by the DOM and SAX-based translators.

_performValidation()

Determine whether the content model should be validated for this instance.

In the absence of context, this returns True iff both binding and document validation are in force.

Deprecated:use _validationConfig and check specific requirements.
_postDOMValidate()
_postFactory_vx(state)

Method invoked prior to leaving the Factory method.

This is an instance method, and is given the state that was returned by _PreFactory_vx.

_resetContent(reset_elements=False)

Reset the content of an element value.

This is not a public method.

For simple types, this does nothing. For complex types, this clears the content array, removing all non-element content from the instance. It optionally also removes all element content.

Parameters:reset_elements – If False (default) only the content array is

cleared, which has the effect of removing any preference for element order when generating a document. If True, the element content stored within the binding is also cleared, leaving it with no content at all.

Note:This is not the same thing as complexTypeDefinition.reset,

which unconditionally resets attributes and element and non-element content.

_setAttributesFromKeywordsAndDOM(kw, dom_node)

Invoke self._setAttribute based on node attributes and keywords.

Though attributes can only legally appear in complexTypeDefinition instances, delayed conditional validation requires caching them in simpleTypeDefinition.

Parameters:kw – keywords passed to the constructor. This map is mutated by

the call: keywords corresponding to recognized attributes are removed.

Parameters:dom_node – an xml.dom Node instance, possibly None
_setElement(elt)

Associate an element binding with the instance.

Since the value of a binding instance reflects only its content, an associated element is necessary to generate an XML document or DOM tree.

Parameters:elt – the pyxb.binding.basis.element instance associated with

the value. This may be None when disassociating a value from a specific element.

_setIsNil(nil=True)

Set the xsi:nil property of the instance.

Parameters:nilTrue if the value of xsi:nil should be true,

False if the value of xsi:nil should be false.

Raises:pyxb.NoNillableSupportError – the instance is not associated

with an element that is L{nillable <pyxb.binding.basis.element.nillable>}.

_setNamespaceContext(namespace_context)

Associate a namespace context with the binding instance.

_setValidationConfig(validation_config)

Set the validation configuration for this instance.

_substitutesFor(element)
_toDOM_csc(dom_support, parent)
_validateBinding_vx()

Override in subclasses for type-specific validation of instance content.

Returns:

True if the instance validates

Raises:
  • pyxb.BatchContentValidationError – complex content does not match model
  • pyxb.SimpleTypeValueError – simple content fails to satisfy constraints
_validationConfig

The pyxb.ValidationConfig instance that applies to this instance.

By default this will reference the class value from _GetValidationConfig, which defaults to pyxb.GlobalValidationConfig.

_validationConfig_ = <pyxb.ValidationConfig object>
toDOM(bds=None, parent=None, element_name=None)

Convert this instance to a DOM node.

The name of the top-level element is either the name of the element instance associated with this instance, or the XML name of the type of this instance.

Parameters:

otherwise, the created element is a child of the given element. :type parent: xml.dom.Element or None :rtype: xml.dom.Document

toxml(encoding=None, bds=None, root_only=False, element_name=None)

Shorthand to get the object as an XML document.

If you want to set the default namespace, pass in a pre-configured bds.

Parameters:encoding – The encoding to be used. See

@:py:obj:xml.dom.Node.toxml() for a description of why you should always pass @:py:obj:‘utf-8’ here. Because this method follows the contract of the corresponding xml.dom.Node method, it does not automatically get the default PyXB output encoding.

Parameters:bds – Optional pyxb.utils.domutils.BindingDOMSupport instance

to use for creation. If not provided (default), a new generic one is created.

Parameters:root_only – Set to True to automatically deference the

documentElement of the resulting DOM node. This eliminates the XML declaration that would otherwise be generated.

Parameters:element_name – This value is passed through to toDOM, and is

useful when the value has no bound element but you want to convert it to XML anyway.

validateBinding()

Check whether the binding content matches its content model.

Returns:

True if validation succeeds.

Raises:
  • pyxb.BatchContentValidationError – complex content does not match model
  • pyxb.SimpleTypeValueError – attribute or simple content fails to satisfy constraints
class pyxb.binding.basis.complexTypeDefinition(*args, **kw)

Bases: pyxb.binding.basis._TypeBinding_mixin, pyxb.utils.utility._DeconflictSymbols_mixin, pyxb.binding.basis._DynamicCreate_mixin

Base for any Python class that serves as the binding for an XMLSchema complexType.

Subclasses should define a class-level _AttributeMap variable which maps from the unicode tag of an attribute to the AttributeUse instance that defines it. Similarly, subclasses should define an _ElementMap variable.

classmethod _AddElement(element)

Method used by generated code to associate the element binding with a use in this type.

This is necessary because all complex type classes appear in the module prior to any of the element instances (which reference type classes), so the association must be formed after the element instances are available.

_Automaton = None
_CT_ELEMENT_ONLY = 'ELEMENT_ONLY'
_CT_EMPTY = 'EMPTY'
_CT_MIXED = 'MIXED'
_CT_SIMPLE = 'SIMPLE'
_ContentTypeTag = None
classmethod _ElementBindingDeclForName(element_name)

Determine what the given name means as an element in this type.

Normally, element_name identifies an element definition within this type. If so, the returned element_decl identifies that definition, and the element_binding is extracted from that use.

It may also be that the element_name does not appear as an element definition, but that it identifies a global element. In that case, the returned element_binding identifies the global element. If, further, that element is a member of a substitution group which does have an element definition in this class, then the returned element_decl identifies that definition.

If a non-None element_decl is returned, there will be an associated element_binding. However, it is possible to return a non-None element_binding, but None as the element_decl. In that case, the element_binding can be used to create a binding instance, but the content model will have to treat it as a wildcard.

Parameters:element_name – The name of the element in this type, either an

expanded name or a local name if the element has an absent namespace.

Returns:( element_binding, element_decl )
_ElementMap = {}

Map from expanded names to ElementDeclaration instances.

_HasWildcardElement = False
classmethod _IsMixed()
classmethod _IsSimpleTypeContent()

CTDs with simple content are simple; other CTDs are not.

_ReservedSymbols = set(['toDOM', 'reset', 'toxml', 'orderedContent', 'xsdConstraintsOK', 'extend', 'wildcardElements', 'Factory', 'value', 'content', 'validateBinding', 'wildcardAttributeMap', 'property', 'append'])
_TypeDefinition = None

Subclass of simpleTypeDefinition that corresponds to the type content. Only valid if _ContentTypeTag is _CT_SIMPLE

classmethod _UseForTag(tag, raise_if_fail=True)

Return the ElementDeclaration object corresponding to the element name.

Parameters:tag – The ExpandedName of an element in the class.
_addContent(wrapped_value)
_appendWildcardElement(value)
_automatonConfiguration()

For whitebox testing use only

_complexTypeDefinition__NeedWarnOnContent = True
classmethod _complexTypeDefinition__WarnOnContent()
_complexTypeDefinition__automatonConfiguration = None
_complexTypeDefinition__childrenForDOM()

Generate a list of children in the order in which they should be added to the parent when creating a DOM representation of this object.

Note:This is only used when pyxb.RequireValidWhenGenerating has

disabled validation. Consequently, it may not generate valid XML.

_complexTypeDefinition__content = None
_complexTypeDefinition__setContent(value)
_complexTypeDefinition__wildcardAttributeMap = None
_complexTypeDefinition__wildcardElements = None
classmethod _description(name_only=False, user_documentation=True)
_finalizeContentModel()
_postDOMValidate()
_resetAutomaton()
_resetContent(reset_elements=False)
_setAttribute(attr_en, value_lex)
_setDOMFromAttributes(dom_support, element)

Add any appropriate attributes from this instance into the DOM element.

_setValue(value)

Change the simple content value without affecting attributes.

_symbolSet()

Return a map from content.ElementDeclaration instances to a list of values associated with that use.

This is used as the set of symbols available for transitions when validating content against a model. Note that the original content.ElementUse that may have validated the assignment of the symbol to the content is no longer available, which may result in a different order being generated by the content model. Preservation of the original order mitigates this risk.

The value None is used to provide the wildcard members, if any.

If an element use has no associated values, it must not appear in the returned map.

Raises:pyxb.SimpleTypeValueError – when unable to convert element

content to the binding declaration type.

_toDOM_csc(dom_support, parent)

Create a DOM element with the given tag holding the content of this instance.

_validateAttributes()
_validateBinding_vx()
_validatedChildren()

Provide the child elements and non-element content in an order consistent with the content model.

Returns a sequence of tuples representing a valid path through the content model where each transition corresponds to one of the member element instances within this instance. The tuple is a pair comprising the content.ElementDeclaration instance and the value for the transition.

If the content of the instance does not validate against the content model, an exception is raised.

Returns:None or a list as described above.
append(value, **kw)

Add the value to the instance.

The value should be a DOM node or other value that is or can be converted to a binding instance, or a string if the instance allows mixed content. The value must be permitted by the content model.

Raises:pyxb.ContentValidationError – the value is not permitted at the current

state of the content model.

content()

Legacy interface for ordered content.

This version does not accurately distinguish non-element content from element content that happens to have unicode type.

Deprecated:use orderedContent.
extend(value_list, _fallback_namespace=None, _from_xml=False, _location=None)

Invoke append for each value in the list, in turn.

orderedContent()

Return the element and non-element content of the instance in order.

This must be a complex type with complex content. The return value is a list of the element and non-element content in a preferred order.

The returned list contains element and non-element content in the order which it was added to the instance. This may have been through parsing a document, constructing an instance using positional arguments, invoking the append or extend methods, or assigning directly to an instance attribute associated with an element binding.

Note:Be aware that assigning directly to an element attribute does not

remove any previous value for the element from the content list.

Note:Be aware that element values directly appended to an instance

attribute with list type (viz., that corresponds to an element that allows more than one occurrence) will not appear in the ordered content list.

The order in the list may influence the generation of documents depending on pyxb.ValidationConfig values that apply to an instance. Non-element content is emitted immediately prior to the following element in this list. Any trailing non-element content is emitted after the last element in the content. The list should include all element content. Element content in this list that is not present within an element member of the binding instance may result in an error, or may be ignored.

Note:The returned value is mutable, allowing the caller to change

the order to be used.

Raises:pyxb.NotComplexContentError – this is not a complex type with mixed or element-only content
reset()

Reset the instance.

This resets all element and attribute fields, and discards any recorded content. It resets the content model automaton to its initial state.

See:Manipulate the return value of orderedContent if your intent is

to influence the generation of documents from the binding instance without changing its (element) content.

value()

Return the value of the element.

This must be a complex type with simple content. The returned value is expected to be an instance of some simpleTypeDefinition class.

Raises:pyxb.NotSimpleContentError – this is not a complex type with simple content
wildcardAttributeMap()

Obtain access to wildcard attributes.

The return value is None if this type does not support wildcard attributes. If wildcard attributes are allowed, the return value is a map from QNames to the unicode string value of the corresponding attribute.

Todo:The map keys should be namespace extended names rather than

QNames, as the in-scope namespace may not be readily available to the user.

wildcardElements()

Obtain access to wildcard elements.

The return value is None if the content model for this type does not support wildcard elements. If wildcard elements are allowed, the return value is a list of values corresponding to conformant unrecognized elements, in the order in which they were encountered. If the containing binding was created from an XML document and enough information was present to determine the binding of the member element, the value is a binding instance. Otherwise, the value is the original DOM Element node.

xsdConstraintsOK(location=None)

Validate the content against the simple type.

Returns:

True if the content validates against its type.

Raises:
  • pyxb.NotSimpleContentError – this type does not have simple content.
  • pyxb.SimpleContentAbsentError – the content of this type has not been set
class pyxb.binding.basis.element(name, type_definition, scope=None, nillable=False, abstract=False, unicode_default=None, fixed=False, substitution_group=None, documentation=None, location=None)

Bases: pyxb.utils.utility._DeconflictSymbols_mixin, pyxb.binding.basis._DynamicCreate_mixin

Class that represents a schema element within a binding.

This gets a little confusing. Within a schema, the pyxb.xmlschema.structures.ElementDeclaration type represents an U{element declaration<http://www.w3.org/TR/xmlschema-1/#cElement_Declarations>}. Those declarations may be global (have a name that is visible in the namespace), or local (have a name that is visible only within a complex type definition). Further, local (but not global) declarations may have a reference to a global declaration (which might be in a different namespace).

Within a PyXB binding, the element declarations from the original complex type definition that have the same QName<http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-qname> (after deconflicting the LocalPart<http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-LocalPart>) are associated with an attribute in the class for the complex type. Each of these attributes is defined via a pyxb.binding.content.ElementDeclaration which provides the mechanism by which the binding holds values associated with that element.

Furthermore, in the FAC-based content model each schema element declaration is associated with an ElementUse instance to locate the point in the schema where content came from. Instances that refer to the same schema element declaration share the same underlying pyxb.binding.content.ElementDeclaration.

This element isn’t any of those elements. This element is the type used for an attribute which associates the name of a element with data required to represent it, all within a particular scope (a module for global scope, the binding class for a complex type definition for local scope). From the perspective of a PyXB user they look almost like a class, in that you can call them to create instances of the underlying complex type.

Global and local elements are represented by instances of this class.

classmethod AnyCreateFromDOM(node, fallback_namespace)

Create an instance of an element from a DOM node.

This method does minimal processing of node and delegates to CreateDOMBinding.

Parameters:node – An xml.dom.Node representing a root element. If the

node is a document, that document’s root node will be substituted. The name of the node is extracted as the name of the element to be created, and the node and the name are passed to CreateDOMBinding.

Parameters:fallback_namespace – The value to pass as _fallback_namespace

to CreateDOMBinding

Returns:As with CreateDOMBinding
classmethod CreateDOMBinding(node, element_binding, **kw)

Create a binding from a DOM node.

Parameters:
  • node – The DOM node
  • element_binding – An instance of element that would normally

be used to determine the type of the binding. The actual type of object returned is determined by the type definition associated with the element_binding and the value of any U{xsi:type <http://www.w3.org/TR/xmlschema-1/#xsi_type>} attribute found in node, modulated by XSI._InterpretTypeAttribute.

Parameters:_fallback_namespace – The namespace to use as the namespace for

the node, if the node name is unqualified. This should be an absent namespace.

Returns:A binding for the DOM node.
Raises:pyxb.UnrecognizedDOMRootNodeError – if no underlying element or

type for the node can be identified.

_createFromDOM(node, expanded_name, **kw)

Create an instance from a DOM node given the name of an element.

This method does minimal processing of node and expanded_name and delegates to CreateDOMBinding.

Parameters:node – An xml.dom.Node representing a root element. If the

node is a document, that document’s root node will be substituted. The value is passed to CreateDOMBinding.

Parameters:expanded_name – The expanded name of the element to be used for

content. This is passed to elementForName to obtain the binding that is passed to CreateDOMBinding, superseding any identification that might be inferred from node. If no name is available, use createFromDOM.

Note:Keyword parameters are passed to CreateDOMBinding.
Returns:As with CreateDOMBinding.
_description(name_only=False, user_documentation=True)
_element__abstract = False
_element__defaultValue = None
_element__documentation = None
_element__fixed = False
_element__name = None
_element__nillable = False
_element__scope = None
_element__substitutionGroup = None
_element__typeDefinition = None
_element__xsdLocation = None
_real_substitutesFor(other)

Determine whether an instance of this element can substitute for the other element.

See Substitution Group OK<http://www.w3.org/TR/xmlschema-1/#cos-equiv-derived-ok-rec>.

Todo:Do something about blocking constraints. This ignores them, as

does everything leading to this point.

_setSubstitutionGroup(substitution_group)
abstract()

Indicate whether this element is abstract (must use substitution group members for matches).

compatibleValue(value, **kw)

Return a variant of the value that is compatible with this element.

This mostly defers to _TypeBinding_mixin._CompatibleValue.

Raises:pyxb.SimpleTypeValueError – if the value is not both

type-consistent and value-consistent with the element’s type.

createFromDOM(node, fallback_namespace=None, **kw)

Create an instance of this element using a DOM node as the source of its content.

This method does minimal processing of node and delegates to _createFromDOM.

Parameters:node – An xml.dom.Node representing a root element. If the

node is a document, that document’s root node will be substituted. The name of the node is extracted as the name of the element to be created, and the node and the name are passed to _createFromDOM

Parameters:fallback_namespace – Used as default for

_fallback_namespace in call to _createFromDOM

Note:Keyword parameters are passed to CreateDOMBinding.
Returns:As with _createFromDOM
defaultValue()

The default value of the element.

None if the element has no default value.

Note:A non-None value is always an instance of a simple type,

even if the element has complex content.

documentation()

Contents of any documentation annotation in the definition.

elementForName(name)

Return the element that should be used if this element binding is permitted and an element with the given name is encountered.

Normally, the incoming name matches the name of this binding, and self is returned. If the incoming name is different, it is expected to be the name of a global element which is within this element’s substitution group. In that case, the binding corresponding to the named element is return.

Returns:An instance of element, or None if no element with the

given name can be found.

findSubstituendDecl(ctd_class)
fixed()

True if the element content cannot be changed

memberElement(name)

Return a reference to the element instance used for the given name within this element.

The type for this element must be a complex type definition.

name()

The expanded name of the element within its scope.

nillable()

Indicate whether values matching this element can have U{nil <http://www.w3.org/TR/xmlschema-1/#xsi_nil>} set.

scope()

The scope of the element. This is either None, representing a top-level element, or an instance of complexTypeDefinition for local elements.

substitutesFor(other)

Stub replaced by _real_substitutesFor when element supports substitution groups.

substitutionGroup()

The element instance to whose substitution group this element belongs. None if this element is not part of a substitution group.

typeDefinition()

The _TypeBinding_mixin subclass for values of this element.

xsdLocation()

The pyxb.utils.utility.Location where the element appears in the schema.

class pyxb.binding.basis.enumeration_mixin(*args, **kw)

Bases: pyxb.cscRoot

Marker in case we need to know that a PST has an enumeration constraint facet.

_ReservedSymbols = set(['items', 'values', 'itervalues', 'iteritems'])
classmethod _elementForValue(value)

Return the _EnumerationElement instance that has the given value.

Raises:KeyError – the value is not valid for the enumeration.
classmethod _valueForUnicode(ustr)

Return the enumeration value corresponding to the given unicode string.

If ustr is not a valid option for this enumeration, return None.

classmethod items()

Return the associated pyxb.binding.facet._EnumerationElement instances.

classmethod iteritems()

Generate the associated pyxb.binding.facet._EnumerationElement instances.

classmethod itervalues()

Return a generator for the values that the enumeration can take.

classmethod values()

Return a list of values that the enumeration can take.

class pyxb.binding.basis.simpleTypeDefinition(*args, **kw)

Bases: pyxb.binding.basis._TypeBinding_mixin, pyxb.utils.utility._DeconflictSymbols_mixin, pyxb.binding.basis._DynamicCreate_mixin

simpleTypeDefinition is a base class that is part of the hierarchy of any class that represents the Python datatype for a SimpleTypeDefinition.

Note:This class, or a descendent of it, must be the first class

in the method resolution order when a subclass has multiple parents. Otherwise, constructor keyword arguments may not be removed before passing them on to Python classes that do not accept them.

classmethod PythonLiteral(value)

Return a string which can be embedded into Python source to represent the given value as an instance of this class.

classmethod SimpleTypeDefinition()

Return the SimpleTypeDefinition instance for the given class.

This should only be invoked when generating bindings. An STD must have been associated with the class using _SimpleTypeDefinition.

classmethod XsdConstraintsOK(value, location=None)

Validate the given value against the constraints on this class.

Raises:pyxb.SimpleTypeValueError – if any constraint is violated.
classmethod XsdLiteral(value)

Convert from a python value to a string usable in an XML document.

This should be implemented in the subclass.

classmethod XsdSuperType()

Find the nearest parent class in the PST hierarchy.

The value for anySimpleType is None; for all others, it’s a primitive or derived PST descendent (including anySimpleType).

classmethod XsdValueLength(value)

Return the length of the given value.

The length is calculated by a subclass implementation of _XsdValueLength_vx in accordance with http://www.w3.org/TR/xmlschema-2/#rf-length.

The return value is a non-negative integer, or None if length constraints should be considered trivially satisfied (as with QName and NOTATION).

Raises:
  • pyxb.LogicError – the provided value is not an instance of cls.
  • pyxb.LogicError – an attempt is made to calculate a length for

an instance of a type that does not support length calculations.

classmethod _CheckValidValue(value)

NB: Invoking this on a value that is a list will, if necessary, replace the members of the list with new values that are of the correct item type. This is permitted because only with lists is it possible to bypass the normal content validation (by invoking append/extend on the list instance).

classmethod _ConvertArguments(args, kw)

Pre-process the arguments.

This is used before invoking the parent constructor. One application is to apply the whitespace facet processing; if such a request is in the keywords, it is removed so it does not propagate to the superclass. Another application is to convert the arguments from a string to a list. Binding-specific applications are performed in the overloaded _ConvertArguments_vx method.

classmethod _ConvertArguments_vx(args, kw)
classmethod _FacetMap()

Return a reference to the facet map for this datatype.

The facet map is a map from leaf facet classes to instances of those classes that constrain or otherwise apply to the lexical or value space of the datatype. Classes may inherit their facet map from their superclass, or may create a new class instance if the class adds a new constraint type.

Raises:AttributeError – if the facet map has not been defined
classmethod _InitializeFacetMap(*args)

Initialize the facet map for this datatype.

This must be called exactly once, after all facets belonging to the datatype have been created.

Raises:
  • pyxb.LogicError – if called multiple times (on the same class)
  • pyxb.LogicError – if called when a parent class facet map has not been initialized
Returns:

the facet map

classmethod _IsSimpleTypeContent()

STDs have simple type content.

classmethod _IsValidValue(value)
_ReservedSymbols = set(['toDOM', 'toxml', 'xsdConstraintsOK', 'XsdValueLength', 'xsdLiteral', 'Factory', 'pythonLiteral', 'XsdPythonType', 'XsdConstraintsOK', 'xsdValueLength', 'XsdLiteral', 'XsdSuperType', 'PythonLiteral', 'validateBinding', 'property', 'SimpleTypeDefinition'])

Symbols that remain the responsibility of this class. Any public symbols in generated binding subclasses are deconflicted by providing an alternative name in the subclass. (There currently are no public symbols in generated SimpleTypeDefinion bindings.

classmethod _SimpleTypeDefinition(std)

Set the pyxb.xmlschema.structures.SimpleTypeDefinition instance associated with this binding.

classmethod _XsdConstraintsPreCheck_vb(value)

Pre-extended class method to verify other things before checking constraints.

This is used for list types, to verify that the values in the list are acceptable, and for token descendents, to check the lexical/value space conformance of the input.

_checkValidValue()
classmethod _description(name_only=False, user_documentation=True)
_isValidValue()
_setAttribute(attr_en, value_lex)
_simpleTypeDefinition__ClassFacetSequence = {}
_simpleTypeDefinition__FacetMap = {}
classmethod _simpleTypeDefinition__FacetMapAttributeName()
_simpleTypeDefinition__FacetMapAttributeNameMap = {<class 'pyxb.binding.datatypes.Name'>: u'_httpwww_w3_org2001XMLSchema_Name_FacetMap', <class 'pyxb.binding.datatypes.token'>: u'_httpwww_w3_org2001XMLSchema_token_FacetMap', <class 'pyxb.binding.datatypes.short'>: u'_httpwww_w3_org2001XMLSchema_short_FacetMap', <class 'pyxb.binding.facets._WhiteSpace_enum'>: u'_httpwww_w3_org2001XMLSchema__WhiteSpace_enum_FacetMap', <class 'pyxb.binding.datatypes.anyURI'>: u'_httpwww_w3_org2001XMLSchema_anyURI_FacetMap', <class 'pyxb.binding.datatypes.unsignedByte'>: u'_httpwww_w3_org2001XMLSchema_unsignedByte_FacetMap', <class 'pyxb.binding.basis.STD_list'>: u'_STD_list_FacetMap', <class 'pyxb.binding.datatypes.normalizedString'>: u'_httpwww_w3_org2001XMLSchema_normalizedString_FacetMap', <class 'pyxb.binding.datatypes.int'>: u'_httpwww_w3_org2001XMLSchema_int_FacetMap', <class 'pyxb.binding.datatypes._fp'>: u'_fp_FacetMap', <class 'pyxb.binding.datatypes.negativeInteger'>: u'_httpwww_w3_org2001XMLSchema_negativeInteger_FacetMap', <class 'pyxb.binding.datatypes.integer'>: u'_httpwww_w3_org2001XMLSchema_integer_FacetMap', <class 'pyxb.binding.datatypes.positiveInteger'>: u'_httpwww_w3_org2001XMLSchema_positiveInteger_FacetMap', <class 'pyxb.binding.datatypes.hexBinary'>: u'_httpwww_w3_org2001XMLSchema_hexBinary_FacetMap', <class 'pyxb.binding.datatypes.ENTITY'>: u'_httpwww_w3_org2001XMLSchema_ENTITY_FacetMap', <class 'pyxb.binding.datatypes.unsignedShort'>: u'_httpwww_w3_org2001XMLSchema_unsignedShort_FacetMap', <class 'pyxb.binding.datatypes.gDay'>: u'_httpwww_w3_org2001XMLSchema_gDay_FacetMap', <class 'pyxb.binding.datatypes.IDREF'>: u'_httpwww_w3_org2001XMLSchema_IDREF_FacetMap', <class 'pyxb.binding.datatypes.unsignedLong'>: u'_httpwww_w3_org2001XMLSchema_unsignedLong_FacetMap', <class 'pyxb.binding.datatypes.gYear'>: u'_httpwww_w3_org2001XMLSchema_gYear_FacetMap', <class 'pyxb.binding.datatypes.float'>: u'_httpwww_w3_org2001XMLSchema_float_FacetMap', <class 'pyxb.binding.datatypes.unsignedInt'>: u'_httpwww_w3_org2001XMLSchema_unsignedInt_FacetMap', <class 'pyxb.binding.datatypes.NCName'>: u'_httpwww_w3_org2001XMLSchema_NCName_FacetMap', <class 'pyxb.binding.datatypes.byte'>: u'_httpwww_w3_org2001XMLSchema_byte_FacetMap', <class 'pyxb.binding.datatypes.NMTOKENS'>: u'_NMTOKENS_FacetMap', <class 'pyxb.binding.datatypes.string'>: u'_httpwww_w3_org2001XMLSchema_string_FacetMap', <class 'pyxb.binding.datatypes.anySimpleType'>: u'_httpwww_w3_org2001XMLSchema_anySimpleType_FacetMap', <class 'pyxb.binding.datatypes._PyXBDateOnly_base'>: u'_PyXBDateOnly_base_FacetMap', <class 'pyxb.binding.datatypes.NOTATION'>: u'_httpwww_w3_org2001XMLSchema_NOTATION_FacetMap', <class 'pyxb.binding.datatypes.boolean'>: u'_httpwww_w3_org2001XMLSchema_boolean_FacetMap', <class 'pyxb.binding.datatypes.nonPositiveInteger'>: u'_httpwww_w3_org2001XMLSchema_nonPositiveInteger_FacetMap', <class 'pyxb.binding.datatypes._PyXBDateTime_base'>: u'_PyXBDateTime_base_FacetMap', <class 'pyxb.binding.datatypes.long'>: u'_httpwww_w3_org2001XMLSchema_long_FacetMap', <class 'pyxb.binding.datatypes.date'>: u'_httpwww_w3_org2001XMLSchema_date_FacetMap', <class 'pyxb.binding.datatypes.time'>: u'_httpwww_w3_org2001XMLSchema_time_FacetMap', <class 'pyxb.binding.datatypes.QName'>: u'_httpwww_w3_org2001XMLSchema_QName_FacetMap', <class 'pyxb.binding.datatypes.language'>: u'_httpwww_w3_org2001XMLSchema_language_FacetMap', <class 'pyxb.binding.datatypes.dateTime'>: u'_httpwww_w3_org2001XMLSchema_dateTime_FacetMap', <class 'pyxb.binding.basis.simpleTypeDefinition'>: '_simpleTypeDefinition__FacetMap', <class 'pyxb.binding.datatypes.NMTOKEN'>: u'_httpwww_w3_org2001XMLSchema_NMTOKEN_FacetMap', <class 'pyxb.binding.datatypes.ENTITIES'>: u'_httpwww_w3_org2001XMLSchema_ENTITIES_FacetMap', <class 'pyxb.binding.datatypes.duration'>: u'_httpwww_w3_org2001XMLSchema_duration_FacetMap', <class 'pyxb.binding.datatypes.gMonth'>: u'_httpwww_w3_org2001XMLSchema_gMonth_FacetMap', <class 'pyxb.binding.datatypes.gYearMonth'>: u'_httpwww_w3_org2001XMLSchema_gYearMonth_FacetMap', <class 'pyxb.binding.datatypes.IDREFS'>: u'_httpwww_w3_org2001XMLSchema_IDREFS_FacetMap', <class 'pyxb.binding.datatypes.double'>: u'_httpwww_w3_org2001XMLSchema_double_FacetMap', <class 'pyxb.binding.datatypes.gMonthDay'>: u'_httpwww_w3_org2001XMLSchema_gMonthDay_FacetMap', <class 'pyxb.binding.datatypes.base64Binary'>: u'_httpwww_w3_org2001XMLSchema_base64Binary_FacetMap', <class 'pyxb.binding.datatypes.decimal'>: u'_httpwww_w3_org2001XMLSchema_decimal_FacetMap', <class 'pyxb.binding.datatypes.ID'>: u'_httpwww_w3_org2001XMLSchema_ID_FacetMap', <class 'pyxb.binding.datatypes.nonNegativeInteger'>: u'_httpwww_w3_org2001XMLSchema_nonNegativeInteger_FacetMap'}
classmethod _simpleTypeDefinition__STDAttrName()
_toDOM_csc(dom_support, parent)
_validateBinding_vx()
pythonLiteral()

Return a string which can be embedded into Python source to represent the value of this instance.

xsdConstraintsOK(location=None)

Validate the value of this instance against its constraints.

xsdLiteral()

Return text suitable for representing the value of this instance in an XML document.

The base class implementation delegates to the object class’s XsdLiteral method.

xsdValueLength()

Return the length of this instance within its value space.

See XsdValueLength.

pyxb.binding.content module

Helper classes that maintain the content model of XMLSchema in the binding classes.

AttributeUse and ElementDeclaration record information associated with a binding class, for example the types of values, the original XML QName or NCName, and the Python field in which the values are stored. They also provide the low-level interface to set and get the corresponding values in a binding instance.

Wildcard holds content-related information used in the content model.

class pyxb.binding.content.AttributeUse(name, id, key, data_type, unicode_default=None, fixed=False, required=False, prohibited=False)

Bases: pyxb.cscRoot

A helper class that encapsulates everything we need to know about the way an attribute is used within a binding class.

Attributes are stored internally as pairs (provided, value), where provided is a boolean indicating whether a value for the attribute was provided externally, and value is an instance of the attribute datatype. The provided flag is used to determine whether an XML attribute should be added to a created DOM node when generating the XML corresponding to a binding instance.

_AttributeUse__dataType = None
_AttributeUse__defaultValue = None
_AttributeUse__fixed = False
_AttributeUse__getProvided(ctd_instance)
_AttributeUse__getValue(ctd_instance)

Retrieve the value information for this attribute in a binding instance.

Parameters:ctd_instance (subclass of pyxb.binding.basis.complexTypeDefinition) – The instance object from which the attribute is to be retrieved.
Returns:(provided, value) where provided is a bool and

value is None or an instance of the attribute’s datatype.

_AttributeUse__id = None
_AttributeUse__key = None
_AttributeUse__name = None
_AttributeUse__prohibited = False
_AttributeUse__required = False
_AttributeUse__setValue(ctd_instance, new_value, provided)
_AttributeUse__unicodeDefault = None
_description(name_only=False, user_documentation=True)
addDOMAttribute(dom_support, ctd_instance, element)

If this attribute as been set, add the corresponding attribute to the DOM element.

dataType()

The subclass of pyxb.binding.basis.simpleTypeDefinition of which any attribute value must be an instance.

defaultValue()

The default value of the attribute.

fixed()

True iff the value of the attribute cannot be changed.

id()

Tag used within Python code for the attribute.

This is not used directly in the default code generation template.

key()

String used as key within object dictionary when storing attribute value.

name()

The expanded name of the element.

Return type:pyxb.namespace.ExpandedName
prohibited()

True iff the attribute must not be assigned a value.

provided(ctd_instance)

True iff the given instance has been explicitly given a value for the attribute.

This is used for things like only generating an XML attribute assignment when a value was originally given (even if that value happens to be the default).

required()

True iff the attribute must be assigned a value.

reset(ctd_instance)

Set the value of the attribute in the given instance to be its default value, and mark that it has not been provided.

set(ctd_instance, new_value, from_xml=False)

Set the value of the attribute.

This validates the value against the data type, creating a new instance if necessary.

Parameters:ctd_instance – The binding instance for which the attribute

value is to be set :type ctd_instance: subclass of pyxb.binding.basis.complexTypeDefinition :param new_value: The value for the attribute :type new_value: Any value that is permitted as the input parameter to the Factory method of the attribute’s datatype. :param from_xml: Value True iff the new_value is known to be in lexical space and must by converted by the type factory. If False (default) the value is only converted if it is not already an instance of the attribute’s underlying type.

validate(ctd_instance)

Validate the instance against the requirements imposed by this attribute use.

There is no return value; calls raise an exception if the content does not validate.

:param ctd_instance : An instance of a complex type definition.

Raises:
  • pyxb.ProhibitedAttributeError – when instance has attribute but must not
  • pyxb.MissingAttributeError – when instance lacks attribute but

must have it (including when a required fixed-value attribute is missing). :raise pyxb.BatchContentValidationError: when instance has attribute but its value is not acceptable

value(ctd_instance)

Get the value of the attribute from the instance.

class pyxb.binding.content.AutomatonConfiguration(instance)

Bases: object

State for a pyxb.utils.fac.Automaton monitoring content for an incrementally constructed complex type binding instance.

Warning:This is not an implementation of

pyxb.utils.fac.Configuration_ABC because we need the step function to return a different type of value.

PermittedNondeterminism = 20

The maximum amount of unresolved non-determinism that is acceptable. If the value is exceeded, a pyxb.ContentNondeterminismExceededError exception will be raised.

_AutomatonConfiguration__cfg = None
_AutomatonConfiguration__discardPreferredSequence(preferred_sequence, pi=None)

Extract non-element content from the sequence and return None.

_AutomatonConfiguration__instance = None
_AutomatonConfiguration__multi = None
_AutomatonConfiguration__pendingNonElementContent = None
_AutomatonConfiguration__preferredPendingSymbol = None
_AutomatonConfiguration__preferredSequenceIndex = 0
_AutomatonConfiguration__processPreferredSequence(preferred_sequence, symbol_set, vc)
_AutomatonConfiguration__resetPreferredSequence(instance)
_diagnoseIncompleteContent(symbols, symbol_set)

Check for incomplete content.

Raises:pyxb.IncompleteElementContentError – if a non-accepting state is found
Returns:the topmost configuration (if accepting)
acceptableContent()

Return the sequence of acceptable symbols at this state.

The list comprises the pyxb.binding.content.ElementUse and pyxb.binding.content.WildcardUse instances that are used to validate proposed symbols, in preferred order.

diagnoseIncompleteContent()

Generate the exception explaining why the content is incomplete.

isAccepting(raise_if_rejecting=False)

Return True iff the automaton is in an accepting state.

If the automaton has unresolved nondeterminism, it is resolved first, preferring accepting states.

nondeterminismCount()

Return the number of pending configurations.

The automaton is deterministic if exactly one configuration is available.

reset()

Reset the automaton to its initial state.

Subsequent transitions are expected based on candidate content to be supplied through the step method.

resolveNondeterminism(prefer_accepting=True)

Resolve any non-determinism in the automaton state.

If the automaton has reached a single configuration (was deterministic), this does nothing.

If multiple candidate configurations are available, the best one is selected and applied, updating the binding instance with the pending content.

“Best” in this case is determined by optionally eliminating configurations that are not accepting, then selecting the path where the initial transition sorts highest using the binding sort key (based on position in the original schema).

Parameters:prefer_accepting – eliminate non-accepting paths if any

accepting path is present.

sequencedChildren()

Implement pyxb.binding.basis.complexTypeDefinition._validatedChildren.

Go there for the interface.

step(value, element_decl)

Attempt a transition from the current state.

Parameters:value – the content to be supplied. For success the value must

be consistent with the recorded symbol (element or wildcard declaration) for a transition from the current automaton state.

Parameters:element_decl – optional

pyxb.binding.content.ElementDeclaration that is the preferred symbol for the transition.

Returns:the cardinal number of successful transitions from the

current configuration based on the parameters.

class pyxb.binding.content.ElementDeclaration(name, id, key, is_plural, location, element_binding=None)

Bases: object

Aggregate the information relevant to an element of a complex type.

This includes the original tag name, the spelling of L{the corresponding object in Python <id>}, an indicator of whether multiple instances might be associated with the field, and other relevant information.

_ElementDeclaration__elementBinding = None
_ElementDeclaration__id = None
_ElementDeclaration__isPlural = False
_ElementDeclaration__key = None
_ElementDeclaration__name = None
_ElementDeclaration__xsdLocation = None
_description(name_only=False, user_documentation=True)
_matches(value, element_decl)
_setElementBinding(element_binding)
append(ctd_instance, value)

Add the given value as another instance of this element within the binding instance. :raise pyxb.StructuralBadDocumentError: invoked on an element use that is not plural

defaultValue()

Return the default value for this element.

For plural values, this is an empty collection. For non-plural values, it is None unless the element has a default value, in which case it is that value.

Todo:This should recursively support filling in default content, as

when the plural list requires a non-zero minimum number of entries.

elementBinding()

The basis.element instance identifying the information associated with the element declaration.

id()

The string name of the binding class field used to hold the element values.

This is the user-visible name, and excepting disambiguation will be equal to the local name of the element.

isPlural()

True iff the content model indicates that more than one element can legitimately belong to this use.

This includes elements in particles with maxOccurs greater than one, and when multiple elements with the same NCName are declared in the same type.

name()

The expanded name of the element.

Return type:pyxb.namespace.ExpandedName
reset(ctd_instance)

Set the value for this use in the given element to its default.

resetValue()

Return the reset value for this element.

For plural values, this is an empty collection. For non-plural values, it is None, corresponding to absence of an assigned element.

set(ctd_instance, value)

Set the value of this element in the given instance.

setOrAppend(ctd_instance, value)

Invoke either set or append, depending on whether the element use is plural.

toDOM(dom_support, parent, value)

Convert the given value to DOM as an instance of this element.

Parameters:
  • dom_support (pyxb.utils.domutils.BindingDOMSupport) – Helper for managing DOM properties
  • parent (xml.dom.Element) – The DOM node within which this element should be generated.
  • value – The content for this element. May be text (if the

element allows mixed content), or an instance of basis._TypeBinding_mixin.

Raises:pyxb.AbstractElementError – the binding to be used is abstract
value(ctd_instance)

Return the value for this use within the given instance.

Note that this is the resetValue(), not the defaultValue(), if the element has not yet been assigned a value.

xsdLocation()

The location in the schema where the element was declared.

Note that this is not necessarily the same location as its use.

class pyxb.binding.content.ElementUse(element_declaration, xsd_location)

Bases: pyxb.binding.content._FACSymbol

Information about a schema element declaration reference.

This is used by the FAC content model to identify the location within a schema at which an element use appears. The ElementDeclaration is not sufficient since multiple uses in various schema, possibly in different namespaces, may refer to the same declaration but be independent uses.

_ElementUse__elementDeclaration = None
consumingClosure(sym)
elementBinding()

Return the element binding associated with the use.

Equivalent to elementDeclaration`().:py:obj:`elementBinding().

elementDeclaration()

Return the element declaration associated with the use.

match(symbol)

Satisfy pyxb.utils.fac.SymbolMatch_mixin.

Determine whether the proposed content encapsulated in symbol is compatible with the element declaration. If so, the accepted value is cached internally and return True; otherwise return False.

Parameters:symbol – a pair (value, element_decl).

pyxb.binding.content.ElementDeclaration._matches is used to determine whether the proposed content is compatible with this element declaration.

matchValue(sym)
typeDefinition()

Return the element type.

Equivalent to elementDeclaration`().:py:obj:`elementBinding().:py:obj:typeDefinition()<pyxb.binding.basis.element.typeDefinition>.

class pyxb.binding.content.Wildcard(*args, **kw)

Bases: object

Placeholder for wildcard objects.

NC_any = '##any'
NC_local = '##local'
NC_not = '##other'
NC_targetNamespace = '##targetNamespace'
PC_lax = 'lax'

Validate against available uniquely determined declaration.

PC_skip = 'skip'

No namespace constraint is applied to the wildcard.

PC_strict = 'strict'

Validate against declaration or xsi:type, which must be available.

_Wildcard__namespaceConstraint = None
_Wildcard__normalizeNamespace(nsv)
_Wildcard__processContents = None
matches(instance, value)

Return True iff the value is a valid match against this wildcard.

Validation per Wildcard allows Namespace Name<http://www.w3.org/TR/xmlschema-1/#cvc-wildcard-namespace>.

namespaceConstraint()

A constraint on the namespace for the wildcard.

Valid values are:

Namespaces are represented by their URIs. Absence is represented by None, both in the “not” pair and in the set.

processContents()

Indicate how this wildcard’s contents should be processed.

class pyxb.binding.content.WildcardUse(wildcard_declaration, xsd_location)

Bases: pyxb.binding.content._FACSymbol

Information about a schema wildcard element.

This is functionally parallel to ElementUse, but references a Wildcard that is unique to this instance. That Wildcard is not incorporated into this class is an artifact of the evolution of PyXB.

_WildcardUse__wildcardDeclaration = None
consumingClosure(sym)

Create a closure that will apply the value accepted by match to a to-be-supplied instance.

match(symbol)

Satisfy pyxb.utils.fac.SymbolMatch_mixin.

Determine whether the proposed content encapsulated in symbol is compatible with the wildcard declaration. If so, the accepted value is cached internally and return True; otherwise return False.

Parameters:symbol – a pair (value, element_decl).

pyxb.binding.content.Wildcard.matches is used to determine whether the proposed content is compatible with this wildcard.

matchValue(sym)
wildcardDeclaration()
class pyxb.binding.content._FACSymbol(xsd_location)

Bases: pyxb.utils.fac.SymbolMatch_mixin

Base class for pyxb.utils.fac.Symbol instances associated with PyXB content models.

This holds the location in the schema of the ElementUse or WildcardUse and documents the methods expected of its children.

_FACSymbol__xsdLocation = None
consumingClosure(sym)

Create a closure that will apply the value from sym to a to-be-supplied instance.

This is necessary for non-deterministic automata, where we can’t store the value into the instance field until we know that the transition will be taken:

Returns:A closure that takes a complexTypeDefinition instance and

stores the value from invoking matchValue on sym into the appropriate slot.

matchValue(sym)

Return the value accepted by match for this symbol.

A match for an element declaration might have resulted in a type change for the value (converting it to an acceptable type). There is no safe place to cache the compatible value calculated in the match while other candidates are being considered, so we need to re-calculate it if the transition is taken.

If the match could not have changed the value, the value from the symbol may be returned immediately.

xsdLocation()
class pyxb.binding.content._PluralBinding(*args, **kw)

Bases: _abcoll.MutableSequence

Helper for element content that supports multiple occurences.

This is an adapter for Python list. Any operation that can mutate an item in the list ensures the stored value is compatible with the element for which the list holds values.

_PluralBinding__convert(v)
_PluralBinding__elementBinding = None
_PluralBinding__list = None
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 164
_abc_registry = <_weakrefset.WeakSet object>
append(x)
count(x)
extend(x)
index(x, i=0, j=-1)
insert(i, x)
pop(i=-1)
remove(x)
reverse()
sort(key=None, reverse=False)

pyxb.binding.datatypes module

Classes supporting XMLSchema Part 2: Datatypes<http://www.w3.org/TR/xmlschema-2/>.

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.

class pyxb.binding.datatypes.ENTITIES(*args, **kw)

Bases: pyxb.binding.basis.STD_list

XMLSchema datatype ENTITIES<http:///www.w3.org/TR/xmlschema-2/#ENTITIES>.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_ItemType

alias of ENTITY

_httpwww_w3_org2001XMLSchema_ENTITIES_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.ENTITY(*args, **kw)

Bases: pyxb.binding.datatypes.NCName

XMLSchema datatype ENTITY<http:///www.w3.org/TR/xmlschema-2/#ENTITY>.

_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_ENTITY_FacetMap = {}
class pyxb.binding.datatypes.ID(*args, **kw)

Bases: pyxb.binding.datatypes.NCName

XMLSchema datatype ID<http:///www.w3.org/TR/xmlschema-2/#ID>.

_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_ID_FacetMap = {}
class pyxb.binding.datatypes.IDREF(*args, **kw)

Bases: pyxb.binding.datatypes.NCName

XMLSchema datatype IDREF<http:///www.w3.org/TR/xmlschema-2/#IDREF>.

_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_IDREF_FacetMap = {}
class pyxb.binding.datatypes.IDREFS(*args, **kw)

Bases: pyxb.binding.basis.STD_list

XMLSchema datatype IDREFS<http:///www.w3.org/TR/xmlschema-2/#IDREFS>.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_ItemType

alias of IDREF

_httpwww_w3_org2001XMLSchema_IDREFS_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.NCName(*args, **kw)

Bases: pyxb.binding.datatypes.Name

XMLSchema datatype NCName<http:///www.w3.org/TR/xmlschema-2/#NCName>.

See http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName.

_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_ValidRE = <_sre.SRE_Pattern object at 0x3bd73f0>
_httpwww_w3_org2001XMLSchema_NCName_FacetMap = {<class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.NMTOKEN(*args, **kw)

Bases: pyxb.binding.datatypes.token

XMLSchema datatype NMTOKEN<http:///www.w3.org/TR/xmlschema-2/#NMTOKEN>.

See http://www.w3.org/TR/2000/WD-xml-2e-20000814.html#NT-Nmtoken.

NMTOKEN is an identifier that can start with any character that is legal in it.

_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_ValidRE = <_sre.SRE_Pattern object at 0x425ff10>
_httpwww_w3_org2001XMLSchema_NMTOKEN_FacetMap = {<class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.NMTOKENS(*args, **kw)

Bases: pyxb.binding.basis.STD_list

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ItemType

alias of NMTOKEN

_NMTOKENS_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.NOTATION(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition

XMLSchema datatype NOTATION<http://www.w3.org/TR/xmlschema-2/#NOTATION>.

classmethod XsdValueLength(value)

Section 4.3.1.3: Legacy length return None to indicate no check

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_httpwww_w3_org2001XMLSchema_NOTATION_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.Name(*args, **kw)

Bases: pyxb.binding.datatypes.token

XMLSchema datatype Name<http:///www.w3.org/TR/xmlschema-2/#Name>.

See http://www.w3.org/TR/2000/WD-xml-2e-20000814.html#NT-Name.

_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_ValidRE = <_sre.SRE_Pattern object at 0x3bd27a0>
_httpwww_w3_org2001XMLSchema_Name_FacetMap = {<class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.QName(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, pyxb.namespace.ExpandedName

XMLSchema datatype QName<http://www.w3.org/TR/xmlschema-2/#QName>.

classmethod XsdLiteral(value)
classmethod XsdValueLength(value)

Section 4.3.1.3: Legacy length return None to indicate no check

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
classmethod _ConvertArguments_vx(args, kw)
classmethod _ConvertIf(value, xmlns_context)
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

classmethod _XsdConstraintsPreCheck_vb(value)
_httpwww_w3_org2001XMLSchema_QName_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes._PyXBDateOnly_base(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateTime_base, datetime.datetime

classmethod XsdLiteral(value)
_ValidFields = ('year', 'month', 'day')
_XsdBaseType

alias of anySimpleType

class pyxb.binding.datatypes._PyXBDateTime_base(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, pyxb.binding.basis._RepresentAsXsdLiteral_mixin

classmethod XsdLiteral(value)
classmethod _AdjustForTimezone(kw)

Update datetime keywords to account for timezone effects.

All XML schema timezoned times are in UTC, with the time “in its timezone”. If the keywords indicate a non-UTC timezone is in force, and pyxb.PreserveInputTimeZone() has not been set, adjust the values to account for the zone by subtracting the corresponding UTC offset and mark explicitly that the time is in UTC by leaving a tzinfo attribute identifying the UTC time zone.

Parameters:kw – A dictionary of keywords relevant for a date or

time instance. The dictionary is updated by this call.

_DefaultDay = 1
_DefaultMonth = 1
_DefaultYear = 1900
classmethod _LexicalToKeywords(text)
_Lexical_fmt = None

Format for the lexical representation of a date-related instance, excluding timezone.

Subclasses must define this.

_LocalTimeZone = <pyxb.utils.utility.LocalTimeZone object>

A datetime.tzinfo instance representing the local time zone.

_PyXBDateTime_base__LexicalIntegerFields = ('year', 'month', 'day', 'hour', 'minute', 'second')
_PyXBDateTime_base__LexicalREMap = {}
_PyXBDateTime_base__PatternMap = {'%m': '(?P<month>\\d{2})', '%M': '(?P<minute>\\d{2})', '%H': '(?P<hour>\\d{2})', '%d': '(?P<day>\\d{2})', '%Y': '(?P<negYear>-?)(?P<year>\\d{4,})', '%Z': '(?P<tzinfo>Z|[-+]\\d\\d:\\d\\d)', '%S': '(?P<second>\\d{2})(?P<fracsec>\\.\\d+)?'}
classmethod _SetKeysFromPython(python_value, kw, fields)
classmethod _SetKeysFromPython_csc(python_value, kw, fields)
_UTCTimeZone = <pyxb.utils.utility.UTCOffsetTimeZone object>

A datetime.tzinfo instance representing UTC.

class pyxb.binding.datatypes._fp(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, float, pyxb.binding.basis._NoNullaryNonNillableNew_mixin

classmethod XsdLiteral(value)
_XsdBaseType

alias of anySimpleType

class pyxb.binding.datatypes.anySimpleType(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, unicode

XMLSchema datatype anySimpleType<http://www.w3.org/TR/xmlschema-2/#dt-anySimpleType>.

classmethod XsdLiteral(value)
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType = None
class pyxb.binding.datatypes.anyType(*args, **kw)

Bases: pyxb.binding.basis.complexTypeDefinition

XMLSchema datatype anyType<http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-urType>.

_Abstract = False
_AttributeWildcard = <pyxb.binding.content.Wildcard object>
_Automaton = <pyxb.utils.fac.Automaton object>
_ContentTypeTag = 'MIXED'
_DefinitionLocation = pyxb.utils.utility.Location('http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-urType', 1, 1)
_ExpandedName = <pyxb.namespace.ExpandedName object>
_HasWildcardElement = True
classmethod _IsUrType(_c)
class pyxb.binding.datatypes.anyURI(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, unicode

XMLSchema datatype anyURI<http://www.w3.org/TR/xmlschema-2/#anyURI>.

classmethod XsdLiteral(value)
classmethod XsdValueLength(value)
_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_httpwww_w3_org2001XMLSchema_anyURI_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.base64Binary(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, str

XMLSchema datatype base64Binary<http://www.w3.org/TR/xmlschema-2/#base64Binary>.

See also RFC2045<http://tools.ietf.org/html/rfc2045> and RFC4648<http://tools.ietf.org/html/rfc4648>.

classmethod XsdLiteral(value)
classmethod XsdValidateLength(length)

Control the maximum encoded size that is checked for XML literal validity.

Python’s base64 module allows some literals that are invalid according to XML rules. PyXB verifies the validity using a regular expression, which is costly for something that is unlikely to occur. Use this function to inhibit checks for validity based on the length of the XML literal.

Parameters:lengthNone (default) to check all literals,

otherwise the maximum length literal that will be checked. Pass -1 to disable the validity check.

Returns:the previous validation length
classmethod XsdValueLength(value)
_B04 = '[AQgw]'
_B04S = '([AQgw] ?)'
_B16 = '[AEIMQUYcgkosw048]'
_B16S = '([AEIMQUYcgkosw048] ?)'
_B64 = '[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/]'
_B64S = '([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/] ?)'
_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
classmethod _ConvertArguments_vx(args, kw)
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_base64Binary__Lexical_re = <_sre.SRE_Pattern object at 0x3d09cd0>
_base64Binary__Pattern = '^((([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/] ?){4})*((([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/] ?){3}[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/])|(([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/] ?){2}([AEIMQUYcgkosw048] ?)=)|(([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/] ?)([AQgw] ?)= ?=)))?$'
_base64Binary__ValidateLength = None
_httpwww_w3_org2001XMLSchema_base64Binary_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.boolean(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, int, pyxb.binding.basis._NoNullaryNonNillableNew_mixin

XMLSchema datatype boolean<http://www.w3.org/TR/xmlschema-2/#boolean>.

classmethod XsdLiteral(value)
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_httpwww_w3_org2001XMLSchema_boolean_FacetMap = {<class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.byte(*args, **kw)

Bases: pyxb.binding.datatypes.short

XMLSchema datatype byte<http://www.w3.org/TR/xmlschema-2/#byte>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_byte_FacetMap = {<class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>}
class pyxb.binding.datatypes.date(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateOnly_base

XMLSchema datatype date<http://www.w3.org/TR/xmlschema-2/#date>.

This class uses the Python datetime.datetime class as its underlying representation; fields not relevant to this type are derived from 1900-01-01T00:00:00.

Note:Unlike dateTime, timezoned date values are not converted

to UTC. The provided timezone information is retained along with the instance; however, the lexical representation generated for output is canonicalized (timezones no more than 12 hours off UTC).

classmethod XsdLiteral(value)
_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Fields = ('year', 'month', 'day')
_Lexical_fmt = '%Y-%m-%d'
_date__MinutesPerDay = 1440
_date__MinutesPerHalfDay = 720
_date__SecondsPerMinute = 60
_httpwww_w3_org2001XMLSchema_date_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
xsdRecoverableTzinfo()

Return the recoverable tzinfo for the date.

Return a pyxb.utils.utility.UTCOffsetTimeZone instance reflecting the timezone associated with the date, or None if the date is not timezoned.

Note:This is not the recoverable timezone, because timezones are

represented as timedeltas which get normalized in ways that don’t match what we expect for a tzinfo.

class pyxb.binding.datatypes.dateTime(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateTime_base, datetime.datetime

XMLSchema datatype dateTime<http://www.w3.org/TR/xmlschema-2/#dateTime>.

This class uses the Python datetime.datetime class as its underlying representation. Unless pyxb.PreserveInputTimeZone() is used, all timezoned dateTime objects are in UTC. Presence of time zone information in the lexical space is preserved by a non-empty tzinfo field, which should always be zero minutes offset from UTC unless the input time zone was preserved.

Warning:The value space of Python’s datetime.datetime class

is more restricted than that of xs:datetime. As a specific example, Python does not support negative years or years with more than four digits. For now, the convenience of having an object that is compatible with Python is more important than supporting the full value space. In the future, the choice may be left up to the developer.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Lexical_fmt = '%Y-%m-%dT%H:%M:%S'
_XsdBaseType

alias of anySimpleType

_dateTime__CtorFields = ('year', 'month', 'day', 'hour', 'minute', 'second', 'microsecond', 'tzinfo')
_httpwww_w3_org2001XMLSchema_dateTime_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
aslocal()

Returns a datetime.datetime instance denoting the same time as this instance but adjusted to be in the local time zone.

Return type:datetime.datetime (B{NOT} xsd.dateTime)
classmethod today()

Return today.

Just like datetime.datetime.today(), except this one sets a tzinfo field so it’s clear the value is UTC.

class pyxb.binding.datatypes.decimal(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, decimal.Decimal, pyxb.binding.basis._RepresentAsXsdLiteral_mixin, pyxb.binding.basis._NoNullaryNonNillableNew_mixin

XMLSchema datatype decimal<http://www.w3.org/TR/xmlschema-2/#decimal>.

This class uses Python’s decimal.Decimal class to support (by default) 28 significant digits. Only normal and zero values are valid; this means NaN and Infinity may be created during calculations, but cannot be expressed in XML documents.

classmethod XsdLiteral(value)
_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_fractionDigits = <pyxb.binding.facets.CF_fractionDigits object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_totalDigits = <pyxb.binding.facets.CF_totalDigits object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
classmethod _CheckValidValue(value)
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_httpwww_w3_org2001XMLSchema_decimal_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.double(*args, **kw)

Bases: pyxb.binding.datatypes._fp

XMLSchema datatype double<http://www.w3.org/TR/xmlschema-2/#double>.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_double_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.duration(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, datetime.timedelta, pyxb.binding.basis._RepresentAsXsdLiteral_mixin

XMLSchema datatype duration<http://www.w3.org/TR/xmlschema-2/#duration>.

This class uses the Python datetime.timedelta class as its underlying representation. This works fine as long as no months or years are involved, and no negative durations are involved. Because the XML Schema value space is so much larger, it is kept distinct from the Python value space, which reduces to integral days, seconds, and microseconds.

In other words, the implementation of this type is a little shakey.

classmethod XsdLiteral(value)
_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_duration__Lexical_re = <_sre.SRE_Pattern object at 0x4217950>
_duration__PythonFields = ('days', 'seconds', 'microseconds', 'minutes', 'hours')
_duration__XSDFields = ('years', 'months', 'days', 'hours', 'minutes', 'seconds')
_duration__durationData = None
_duration__negativeDuration = None
_httpwww_w3_org2001XMLSchema_duration_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
durationData()
negativeDuration()
class pyxb.binding.datatypes.float(*args, **kw)

Bases: pyxb.binding.datatypes._fp

XMLSchema datatype float<http://www.w3.org/TR/xmlschema-2/#float>.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_float_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.gDay(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateOnly_base

XMLSchema datatype gDay<http://www.w3.org/TR/xmlschema-2/#gDay>.

This class uses the Python datetime.datetime class as its underlying representation; fields not relevant to this type are derived from 1900-01-01T00:00:00.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Lexical_fmt = '---%d'
_ValidFields = ('day',)
_httpwww_w3_org2001XMLSchema_gDay_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.gMonth(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateOnly_base

XMLSchema datatype gMonth<http://www.w3.org/TR/xmlschema-2/#gMonth>.

This class uses the Python datetime.datetime class as its underlying representation; fields not relevant to this type are derived from 1900-01-01T00:00:00.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Lexical_fmt = '--%m'
_ValidFields = ('month',)
_httpwww_w3_org2001XMLSchema_gMonth_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.gMonthDay(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateOnly_base

XMLSchema datatype gMonthDay<http://www.w3.org/TR/xmlschema-2/#gMonthDay>.

This class uses the Python datetime.datetime class as its underlying representation; fields not relevant to this type are derived from 1900-01-01T00:00:00.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Lexical_fmt = '--%m-%d'
_ValidFields = ('month', 'day')
_httpwww_w3_org2001XMLSchema_gMonthDay_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.gYear(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateOnly_base

XMLSchema datatype gYear<http://www.w3.org/TR/xmlschema-2/#gYear>.

This class uses the Python datetime.datetime class as its underlying representation; fields not relevant to this type are derived from 1900-01-01T00:00:00.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Lexical_fmt = '%Y'
_ValidFields = ('year',)
_httpwww_w3_org2001XMLSchema_gYear_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.gYearMonth(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateOnly_base

XMLSchema datatype gYearMonth<http://www.w3.org/TR/xmlschema-2/#gYearMonth>.

This class uses the Python datetime.datetime class as its underlying representation; fields not relevant to this type are derived from 1900-01-01T00:00:00.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Lexical_fmt = '%Y-%m'
_ValidFields = ('year', 'month')
_httpwww_w3_org2001XMLSchema_gYearMonth_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.hexBinary(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, str

XMLSchema datatype hexBinary<http://www.w3.org/TR/xmlschema-2/#hexBinary>.

classmethod XsdLiteral(value)
classmethod XsdValueLength(value)
_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
classmethod _ConvertArguments_vx(args, kw)
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_httpwww_w3_org2001XMLSchema_hexBinary_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.int(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, int, pyxb.binding.basis._NoNullaryNonNillableNew_mixin

XMLSchema datatype int<http://www.w3.org/TR/xmlschema-2/#int>.

classmethod XsdLiteral(value)
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of long

_httpwww_w3_org2001XMLSchema_int_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.integer(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, long, pyxb.binding.basis._NoNullaryNonNillableNew_mixin

XMLSchema datatype integer<http://www.w3.org/TR/xmlschema-2/#integer>.

classmethod XsdLiteral(value)
_CF_fractionDigits = <pyxb.binding.facets.CF_fractionDigits object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of decimal

_httpwww_w3_org2001XMLSchema_integer_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.language(*args, **kw)

Bases: pyxb.binding.datatypes.token

XMLSchema datatype language<http:///www.w3.org/TR/xmlschema-2/#language>

_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_ValidRE = <_sre.SRE_Pattern object>
_httpwww_w3_org2001XMLSchema_language_FacetMap = {<class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.long(*args, **kw)

Bases: pyxb.binding.datatypes.integer

XMLSchema datatype long<http://www.w3.org/TR/xmlschema-2/#long>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_long_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.negativeInteger(*args, **kw)

Bases: pyxb.binding.datatypes.nonPositiveInteger

XMLSchema datatype negativeInteger<http://www.w3.org/TR/xmlschema-2/#negativeInteger>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_negativeInteger_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.nonNegativeInteger(*args, **kw)

Bases: pyxb.binding.datatypes.integer

XMLSchema datatype nonNegativeInteger<http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger>.

_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_nonNegativeInteger_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.nonPositiveInteger(*args, **kw)

Bases: pyxb.binding.datatypes.integer

XMLSchema datatype nonPositiveInteger<http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_nonPositiveInteger_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.normalizedString(*args, **kw)

Bases: pyxb.binding.datatypes.string

XMLSchema datatype normalizedString<http:///www.w3.org/TR/xmlschema-2/#normalizedString>.

Normalized strings can’t have carriage returns, linefeeds, or tabs in them.

_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_InvalidRE = None
_ValidRE = None
classmethod _ValidateString_va(value)

Post-extended method to validate that a string matches a given pattern.

If you can express the valid strings as a compiled regular expression in the class variable _ValidRE, or the invalid strings as a compiled regular expression in the class variable _InvalidRE, you can just use those. If the acceptable matches are any trickier, you should invoke the superclass implementation, and if it returns True then perform additional tests.

classmethod _XsdConstraintsPreCheck_vb(value)
_httpwww_w3_org2001XMLSchema_normalizedString_FacetMap = {<class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>}
_normalizedString__BadChars = <_sre.SRE_Pattern object>
classmethod _normalizedString__ValidateString(value)
class pyxb.binding.datatypes.positiveInteger(*args, **kw)

Bases: pyxb.binding.datatypes.nonNegativeInteger

XMLSchema datatype positiveInteger<http://www.w3.org/TR/xmlschema-2/#positiveInteger>.

_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_positiveInteger_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.short(*args, **kw)

Bases: pyxb.binding.datatypes.int

XMLSchema datatype short<http://www.w3.org/TR/xmlschema-2/#short>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_short_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.string(*args, **kw)

Bases: pyxb.binding.basis.simpleTypeDefinition, unicode

XMLSchema datatype string<http://www.w3.org/TR/xmlschema-2/#string>.

classmethod XsdLiteral(value)
classmethod XsdValueLength(value)
_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_length = <pyxb.binding.facets.CF_length object>
_CF_maxLength = <pyxb.binding.facets.CF_maxLength object>
_CF_minLength = <pyxb.binding.facets.CF_minLength object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_XsdBaseType

alias of anySimpleType

_httpwww_w3_org2001XMLSchema_string_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.time(*args, **kw)

Bases: pyxb.binding.datatypes._PyXBDateTime_base, datetime.time

XMLSchema datatype time<http://www.w3.org/TR/xmlschema-2/#time>.

This class uses the Python datetime.time class as its underlying representation. Note that per the XMLSchema spec, all dateTime objects are in UTC, and that timezone information in the string representation in XML is an indication of the local time zone’s offset from UTC. Presence of time zone information in the lexical space is indicated by the tzinfo field.

Note:pyxb.PreserveInputTimeZone() can be used to bypass the

normalization to UTC.

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
_CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_Lexical_fmt = '%H:%M:%S'
_XsdBaseType

alias of anySimpleType

_httpwww_w3_org2001XMLSchema_time_FacetMap = {<class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
_time__CtorFields = ('hour', 'minute', 'second', 'microsecond', 'tzinfo')
class pyxb.binding.datatypes.token(*args, **kw)

Bases: pyxb.binding.datatypes.normalizedString

XMLSchema datatype token<http:///www.w3.org/TR/xmlschema-2/#token>.

Tokens cannot leading or trailing space characters; any carriage return, line feed, or tab characters; nor any occurrence of two or more consecutive space characters.

_CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
classmethod _ValidateString_va(value)
_httpwww_w3_org2001XMLSchema_token_FacetMap = {<class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>}
class pyxb.binding.datatypes.unsignedByte(*args, **kw)

Bases: pyxb.binding.datatypes.unsignedShort

XMLSchema datatype unsignedByte<http://www.w3.org/TR/xmlschema-2/#unsignedByte>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_unsignedByte_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.unsignedInt(*args, **kw)

Bases: pyxb.binding.datatypes.unsignedLong

XMLSchema datatype unsignedInt<http://www.w3.org/TR/xmlschema-2/#unsignedInt>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_unsignedInt_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.unsignedLong(*args, **kw)

Bases: pyxb.binding.datatypes.nonNegativeInteger

XMLSchema datatype unsignedLong<http://www.w3.org/TR/xmlschema-2/#unsignedLong>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_unsignedLong_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
class pyxb.binding.datatypes.unsignedShort(*args, **kw)

Bases: pyxb.binding.datatypes.unsignedInt

XMLSchema datatype unsignedShort<http://www.w3.org/TR/xmlschema-2/#unsignedShort>.

_CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
_ExpandedName = <pyxb.namespace.ExpandedName object>
_httpwww_w3_org2001XMLSchema_unsignedShort_FacetMap = {<class 'pyxb.binding.facets.CF_totalDigits'>: <pyxb.binding.facets.CF_totalDigits object>, <class 'pyxb.binding.facets.CF_maxExclusive'>: <pyxb.binding.facets.CF_maxExclusive object>, <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.CF_minExclusive object>, <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.CF_minInclusive object>, <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.CF_maxInclusive object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_fractionDigits'>: <pyxb.binding.facets.CF_fractionDigits object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}

pyxb.binding.facets module

Classes related to XMLSchema facets.

The definitions herein are from sections 4.2<http://www.w3.org/TR/xmlschema-2/index.html#rf-facets> and 4.3<http://www.w3.org/TR/xmlschema-2/index.html#rf-facets> of XML Schema Part 2: Datatypes<http://www.w3.org/TR/xmlschema-2/>. Facets are attributes of a datatype that constrain its lexical and value spaces.

class pyxb.binding.facets.CF_enumeration(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._CollectionFacet_mixin, pyxb.binding.facets._LateDatatype_mixin

Capture a constraint that restricts valid values to a fixed set.

A STD that has an enumeration restriction should mix-in pyxb.binding.basis.enumeration_mixin, and should have a class variable titled _CF_enumeration that is an instance of this class.

“unicode” refers to the Unicode string by which the value is represented in XML.

“tag” refers to the Python member reference associated with the enumeration. The value is derived from the unicode value of the enumeration element and an optional prefix that identifies the owning simple type when the tag is promoted to module-level visibility.

“value” refers to the Python value held in the tag

See http://www.w3.org/TR/xmlschema-2/#rf-enumeration

_CF_enumeration__enumPrefix = None
_CF_enumeration__tagToElement = None
_CF_enumeration__unicodeToElement = None
_CF_enumeration__valueToElement = None
_CollectionFacet_itemType

alias of _EnumerationElement

_LateDatatypeBindsSuperclass = False
_Name = 'enumeration'
_validateConstraint_vx(value)
addEnumeration(**kw)
elementForValue(value)

Return the _EnumerationElement instance that has the given value.

Raises:KeyError – the value is not valid for the enumeration.
elements()
Deprecated:Use items or iteritems instead.
enumPrefix()
itervalues()

Generate the enumeration values.

valueForUnicode(ustr)

Return the enumeration value corresponding to the given unicode string.

If ustr is not a valid option for this enumeration, return None.

values()

Return a list of enumeration values.

class pyxb.binding.facets.CF_fractionDigits(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin

Specify the number of sub-unit digits in the value space of the type.

See http://www.w3.org/TR/xmlschema-2/#rf-fractionDigits

_Name = 'fractionDigits'
_ValueDatatype

alias of nonNegativeInteger

_validateConstraint_vx(value)
class pyxb.binding.facets.CF_length(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin

A facet that specifies the length of the lexical representation of a value.

See http://www.w3.org/TR/xmlschema-2/#rf-length

_Name = 'length'
_ValueDatatype

alias of nonNegativeInteger

_validateConstraint_vx(value)
class pyxb.binding.facets.CF_maxExclusive(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin, pyxb.binding.facets._LateDatatype_mixin

Specify the exclusive upper bound of legal values for the constrained type.

See http://www.w3.org/TR/xmlschema-2/#rf-maxExclusive

_LateDatatypeBindsSuperclass = True
_Name = 'maxExclusive'
_validateConstraint_vx(value)
class pyxb.binding.facets.CF_maxInclusive(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin, pyxb.binding.facets._LateDatatype_mixin

Specify the maximum legal value for the constrained type.

See http://www.w3.org/TR/xmlschema-2/#rf-maxInclusive

_LateDatatypeBindsSuperclass = False
_Name = 'maxInclusive'
_validateConstraint_vx(value)
class pyxb.binding.facets.CF_maxLength(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin

A facet that constrains the length of the lexical representation of a value.

See http://www.w3.org/TR/xmlschema-2/#rf-minLength

_Name = 'maxLength'
_ValueDatatype

alias of nonNegativeInteger

_validateConstraint_vx(value)
class pyxb.binding.facets.CF_minExclusive(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin, pyxb.binding.facets._LateDatatype_mixin

Specify the exclusive lower bound of legal values for the constrained type.

See http://www.w3.org/TR/xmlschema-2/#rf-minExclusive

_LateDatatypeBindsSuperclass = True
_Name = 'minExclusive'
_validateConstraint_vx(value)
class pyxb.binding.facets.CF_minInclusive(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin, pyxb.binding.facets._LateDatatype_mixin

Specify the minimum legal value for the constrained type.

See http://www.w3.org/TR/xmlschema-2/#rf-minInclusive

_LateDatatypeBindsSuperclass = False
_Name = 'minInclusive'
_validateConstraint_vx(value)
class pyxb.binding.facets.CF_minLength(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin

A facet that constrains the length of the lexical representation of a value.

See http://www.w3.org/TR/xmlschema-2/#rf-minLength

_Name = 'minLength'
_ValueDatatype

alias of nonNegativeInteger

_validateConstraint_vx(value)
class pyxb.binding.facets.CF_pattern(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._CollectionFacet_mixin

A facet that constrains the lexical representation of a value to match one of a set of patterns.

See http://www.w3.org/TR/xmlschema-2/#rf-pattern

Note:In PyXB, pattern constraints are ignored for any type with

a Python representation that does not derive from a string type. This is due to the difficulty in reconstructing the lexical representation of a non-string type after it has been converted to its value space.

Todo:On creating new instances of non-string simple types from

string representations, we could apply pattern constraints. That would mean checking them prior to invoking the Factory method.

_CF_pattern__patternElements = None
_CollectionFacet_itemType

alias of _PatternElement

_Name = 'pattern'
_ValueDatatype

alias of string

_validateConstraint_vx(value)
addPattern(**kw)
patternElements()
class pyxb.binding.facets.CF_totalDigits(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin

Specify the number of digits in the value space of the type.

See http://www.w3.org/TR/xmlschema-2/#rf-totalDigits

_Name = 'totalDigits'
_ValueDatatype

alias of positiveInteger

_validateConstraint_vx(value)
class pyxb.binding.facets.CF_whiteSpace(**kw)

Bases: pyxb.binding.facets.ConstrainingFacet, pyxb.binding.facets._Fixed_mixin

Specify the value-space interpretation of whitespace.

See http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace

_CF_whiteSpace__MultiSpace_re = <_sre.SRE_Pattern object>
_CF_whiteSpace__TabCRLF_re = <_sre.SRE_Pattern object>
_Name = 'whiteSpace'
_ValueDatatype

alias of _WhiteSpace_enum

_validateConstraint_vx(value)

No validation rules for whitespace facet.

normalizeString(value)

Normalize the given string in accordance with the configured whitespace interpretation.

class pyxb.binding.facets.ConstrainingFacet(**kw)

Bases: pyxb.binding.facets.Facet

One of the facets defined in section 4.3, which provide constraints on the lexical space of a type definition.

Facets = [<class 'pyxb.binding.facets.CF_length'>, <class 'pyxb.binding.facets.CF_minLength'>, <class 'pyxb.binding.facets.CF_maxLength'>, <class 'pyxb.binding.facets.CF_pattern'>, <class 'pyxb.binding.facets.CF_enumeration'>, <class 'pyxb.binding.facets.CF_whiteSpace'>, <class 'pyxb.binding.facets.CF_minInclusive'>, <class 'pyxb.binding.facets.CF_maxInclusive'>, <class 'pyxb.binding.facets.CF_minExclusive'>, <class 'pyxb.binding.facets.CF_maxExclusive'>, <class 'pyxb.binding.facets.CF_totalDigits'>, <class 'pyxb.binding.facets.CF_fractionDigits'>]
_ConstrainingFacet__setFromKeywords(**kw)
_FacetPrefix = 'CF'
_setFromKeywords_vb(**kw)

Extend base class.

Additional keywords: * value

_validateConstraint_vx(value)
validateConstraint(value)

Return True iff the given value satisfies the constraint represented by this facet instance.

The actual test is delegated to the subclasses.

class pyxb.binding.facets.FF_bounded(**kw)

Bases: pyxb.binding.facets.FundamentalFacet

Specifies that the associated type supports a notion of bounds.

See http://www.w3.org/TR/xmlschema-2/#rf-bounded

_Name = 'bounded'
_ValueDatatype

alias of boolean

class pyxb.binding.facets.FF_cardinality(**kw)

Bases: pyxb.binding.facets.FundamentalFacet

Specifies that the associated type supports a notion of length.

See http://www.w3.org/TR/xmlschema-2/#rf-cardinality

_LegalValues = ('finite', 'countably infinite')
_Name = 'cardinality'
_ValueDatatype

alias of string

class pyxb.binding.facets.FF_equal(**kw)

Bases: pyxb.binding.facets.FundamentalFacet

Specifies that the associated type supports a notion of equality.

See http://www.w3.org/TR/xmlschema-2/#equal

_Name = 'equal'
class pyxb.binding.facets.FF_numeric(**kw)

Bases: pyxb.binding.facets.FundamentalFacet

Specifies that the associated type represents a number.

See http://www.w3.org/TR/xmlschema-2/#rf-numeric

_Name = 'numeric'
_ValueDatatype

alias of boolean

class pyxb.binding.facets.FF_ordered(**kw)

Bases: pyxb.binding.facets.FundamentalFacet

Specifies that the associated type supports a notion of order.

See http://www.w3.org/TR/xmlschema-2/#rf-ordered

_LegalValues = ('false', 'partial', 'total')
_Name = 'ordered'
_ValueDatatype

alias of string

class pyxb.binding.facets.Facet(**kw)

Bases: pyxb.cscRoot

The base class for facets.

This provides association with STDs, a name, and a value for the facet.

classmethod ClassForFacet(name)

Given the name of a facet, return the Facet subclass that represents it.

Facets = [<class 'pyxb.binding.facets.CF_length'>, <class 'pyxb.binding.facets.CF_minLength'>, <class 'pyxb.binding.facets.CF_maxLength'>, <class 'pyxb.binding.facets.CF_pattern'>, <class 'pyxb.binding.facets.CF_enumeration'>, <class 'pyxb.binding.facets.CF_whiteSpace'>, <class 'pyxb.binding.facets.CF_minInclusive'>, <class 'pyxb.binding.facets.CF_maxInclusive'>, <class 'pyxb.binding.facets.CF_minExclusive'>, <class 'pyxb.binding.facets.CF_maxExclusive'>, <class 'pyxb.binding.facets.CF_totalDigits'>, <class 'pyxb.binding.facets.CF_fractionDigits'>, <class 'pyxb.binding.facets.FF_equal'>, <class 'pyxb.binding.facets.FF_ordered'>, <class 'pyxb.binding.facets.FF_bounded'>, <class 'pyxb.binding.facets.FF_cardinality'>, <class 'pyxb.binding.facets.FF_numeric'>]
classmethod Name()

The name of a facet is a class constant.

_Facet__annotation = None
_Facet__baseTypeDefinition = None
_Facet__ownerTypeDefinition = None
_Facet__value = None
_Facet__valueDatatype = None
_Name = None
_ValueDatatype = None
_setFromKeywords_vb(**kw)

Configure values of the facet from a set of keywords.

This method is pre-extended; subclasses should invoke the parent method after setting their local configuration.

Parameters:
  • _reset – If False or missing, existing values will be retained if they do not appear in the keywords. If True, members not defined in the keywords are set to a default.
  • base_type_definition
  • owner_type_definition
  • value_datatype
_value(v)
_valueString()
annotation()
baseTypeDefinition()

The SimpleTypeDefinition component restricted by this facet.

Note: this is NOT the STD to which the facet belongs, but is usually that STD’s base type. I.e., this jumps us through all the containing restrictions and extensions to get to the core type definition.

ownerTypeDefinition()

The SimpleTypeDefinition component to which this facet belongs.

I.e., the one in which the hasFacet specification was found. This value is None if the facet is not associated with an STD.

setFromKeywords(**kw)

Public entrypoint to the _setFromKeywords_vb call hierarchy.

value()
valueDatatype()

Get the datatype used to represent values of the facet.

This usually has nothing to do with the owner datatype; for example, the length facet may apply to any STD but the value of the facet is an integer. In generated bindings this is usually set explicitly in the facet constructor; when processing a schema, it is derived from the value’s type definition.

class pyxb.binding.facets.FundamentalFacet(**kw)

Bases: pyxb.binding.facets.Facet

A fundamental facet provides information on the value space of the associated type.

classmethod CreateFromDOM(node, owner_type_definition, base_type_definition=None)
Facets = [<class 'pyxb.binding.facets.FF_equal'>, <class 'pyxb.binding.facets.FF_ordered'>, <class 'pyxb.binding.facets.FF_bounded'>, <class 'pyxb.binding.facets.FF_cardinality'>, <class 'pyxb.binding.facets.FF_numeric'>]
_FacetPrefix = 'FF'
_updateFromDOM(node)
updateFromDOM(node)
class pyxb.binding.facets._CollectionFacet_mixin(*args, **kw)

Bases: pyxb.cscRoot

Mix-in to handle facets whose values are collections, not scalars.

For example, the enumeration and pattern facets maintain a list of enumeration values and patterns, respectively, as their value space.

Subclasses must define a class variable _CollectionFacet_itemType which is a reference to a class that is used to construct members of the collection.

_CollectionFacet_mixin__items = None
_items()

The members of the collection, as a reference.

_setFromKeywords_vb(**kw)

Extend base class.

Parameters:_constructor – If False or absent, the object being set is a member of the collection. If True, the object being set is the collection itself.
items()

The members of the collection, as a copy.

iteritems()

The members of the collection as an iterator

class pyxb.binding.facets._EnumerationElement(enumeration=None, unicode_value=None, description=None, annotation=None, tag=None, **kw)

Bases: object

This class represents individual values that appear within a CF_enumeration collection.

_EnumerationElement__enumeration = None
_EnumerationElement__tag = None
_EnumerationElement__unicodeValue = None
_EnumerationElement__value = None
_setTag(tag)

Set the tag to be used for this enumeration.

enumeration()

A reference to the CF_enumeration instance that owns this element.

tag()

The Python identifier used for the named constant representing the enumeration value.

This should include any desired prefix, since it must be unique within its binding class. If None, no enumeration constant will be generated.

unicodeValue()

The unicode string that defines the enumeration value.

value()

The Python value that is used for equality testing against this enumeration.

This is an instance of enumeration.valueDatatype(), initialized from the unicodeValue.

class pyxb.binding.facets._Enumeration_mixin(*args, **kw)

Bases: pyxb.cscRoot

Marker class to indicate that the generated binding has enumeration members.

classmethod valueForUnicode(ustr)
class pyxb.binding.facets._Fixed_mixin(*args, **kw)

Bases: pyxb.cscRoot

Mix-in to a constraining facet that adds support for the ‘fixed’ property.

_Fixed_mixin__fixed = None
_Fixed_mixin__setFromKeywords(**kw)
_setFromKeywords_vb(**kw)

Extend base class.

Additional keywords: * fixed

fixed()
class pyxb.binding.facets._LateDatatype_mixin(*args, **kw)

Bases: pyxb.cscRoot

Marker class to indicate that the facet instance must be told its datatype when it is constructed.

This is necessary for facets like CF_minInclusive and CF_minExclusive, for which the value is determined by the base type definition of the associated STD. In some cases the value that must be used in the facet cannot be represented in the Python type used for the facet; see LateDatatypeBindsSuperclass.

classmethod BindingValueDatatype(value_type)

Find the datatype for facet values when this facet is bound to the given value_type.

If the value_type is an STD, the associated Python support datatype from this value_type scanning up through the base type hierarchy is used.

classmethod LateDatatypeBindsSuperclass()

Return true if false if the proposed datatype should be used, or True if the base type definition of the proposed datatype should be used.

_LateDatatypeBindsSuperclass = None

The class variable that indicates that the Subclasses must override this variable with a value of True or False. The value is True iff the value used for the facet is not within the value space of the corresponding value datatype; for example, CF_minExclusive.

bindValueDatatype(value_datatype)
class pyxb.binding.facets._PatternElement(pattern=None, value=None, annotation=None, **kw)

Bases: pyxb.utils.utility.PrivateTransient_mixin

This class represents individual patterns that appear within a CF_pattern collection.

_PatternElement__PrivateTransient = set(['compiledExpression'])
_PatternElement__compiledExpression = None
_PatternElement__pythonExpression = None
annotation = None
matches(text)
pattern = None
class pyxb.binding.facets._WhiteSpace_enum(*args, **kw)

Bases: pyxb.binding.datatypes.NMTOKEN, pyxb.binding.facets._Enumeration_mixin

The enumeration used to constrain the whiteSpace facet

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_httpwww_w3_org2001XMLSchema__WhiteSpace_enum_FacetMap = {<class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>}
collapse = u'collapse'
preserve = u'preserve'
replace = u'replace'

pyxb.binding.generate module

The really ugly code that generates the Python bindings. This whole thing is going to be refactored once customized generation makes it to the top of the task queue.

class pyxb.binding.generate.BindingIO(binding_module, **kw)

Bases: object

_BindingIO__bindingFile = None
_BindingIO__bindingFilePath = None
_BindingIO__bindingModule = None
_BindingIO__postscript = None
_BindingIO__prolog = None
_BindingIO__stringIO = None
_BindingIO__templateMap = None
appendPrologBoilerplate(tm)
bindingFile()
bindingModule()
contents()
expand(template, **kw)
literal(*args, **kw)
postscript()
prolog()
write(template, **kw)
pyxb.binding.generate.BuildPluralityData(term_tree)

Walk a term tree to determine which element declarations may appear multiple times.

The bindings need to use a list for any Python attribute corresponding to an element declaration that can occur multiple times in the content model. The number of occurrences is determined by the occurrence constraints on parent particles and the compositors of containing model groups. All this information is available in the term tree used for the content model automaton.

Parameters:term_tree – A FAC term tree

representing the content model for a complex data type.

Returns:Plurality data, as a pair (singles, multiples) where

singles is a set of base L{element declarations<xs.structures.ElementDeclaration>} that are known to occur at least once and at most once in a region of the content, and multiples is a similar set of declarations that are known to potentially occur more than once.

pyxb.binding.generate.BuildTermTree(node)

Construct a FAC term tree for a particle.

This translates the XML schema content model of particles, model groups, element declarations, and wildcards into a tree expressing the corresponding content as a regular expression with numerical constraints.

Parameters:node – An instance of xs.structures.Particle
Returns:An instance of pyxb.utils.fac.Node
pyxb.binding.generate.GenerateAutomaton(ctd, **kw)
pyxb.binding.generate.GenerateCTD(ctd, generator, **kw)
pyxb.binding.generate.GenerateED(ed, generator, **kw)
pyxb.binding.generate.GenerateFacets(td, generator, **kw)
pyxb.binding.generate.GeneratePython(schema_location=None, schema_text=None, namespace=None, module_prefix_elts=[], **kw)
pyxb.binding.generate.GenerateSTD(std, generator)
class pyxb.binding.generate.Generator(*args, **kw)

Bases: object

Configuration and data for a single binding-generation action.

_DEFAULT_bindingRoot = '.'
_Generator__OptionSetters = (('binding_root', <function setBindingRoot>), ('schema_root', <function setSchemaRoot>), ('schema_stripped_prefix', <function setSchemaStrippedPrefix>), ('location_prefix_rewrite', <function argAddLocationPrefixRewrite>), ('schema_location', <function setSchemaLocationList>), ('module', <function _setModuleList>), ('module_prefix', <function setModulePrefix>), ('archive_path', <function setArchivePath>), ('no_load_namespace', <function _setNoLoadNamespaces>), ('import_augmentable_namespace', <function _setImportAugmentableNamespaces>), ('archive_to_file', <function setArchiveToFile>), ('default_namespace_public', <function setDefaultNamespacePublic>), ('validate_changes', <function setValidateChanges>), ('write_for_customization', <function setWriteForCustomization>), ('allow_builtin_generation', <function setAllowBuiltinGeneration>), ('allow_absent_module', <function setAllowAbsentModule>), ('uri_content_archive_directory', <function setUriContentArchiveDirectory>), ('logging_config_file', <function setLoggingConfigFile>))
_Generator__allowAbsentModule = None
_Generator__allowBuiltinGeneration = None
_Generator__archivePath = None
_Generator__archiveToFile = None
_Generator__bindingModules = None
_Generator__bindingRoot = None
_Generator__componentGraph = None
_Generator__componentOrder = None
_Generator__defaultNamespacePublic = None
_Generator__didResolveExternalSchema = False
_Generator__generateBindings()
_Generator__generateToFiles = None
_Generator__generationUID = None
_Generator__graphFromComponents(components, include_lax)
_Generator__importAugmentableNamespaces = None
_Generator__locationPrefixMap = {}
_Generator__loggingConfigFile = None
_Generator__moduleFilePath(module_elts, inhibit_extension=False)
_Generator__moduleList = None
_Generator__modulePrefix = None
_Generator__moduleRecords = None
_Generator__namespaceModuleMap = None
_Generator__namespaceVisibilityMap = None
_Generator__namespaces = None
_Generator__noloadNamespaces = None
_Generator__optionParser = None
_Generator__resolveComponentDependencies()
_Generator__schemaLocationList = None
_Generator__schemaRoot = None
_Generator__schemaStrippedPrefix = None
_Generator__schemas = None
_Generator__stripSpaces(string)
_Generator__stripSpaces_re = <_sre.SRE_Pattern object>
_Generator__uriContentArchiveDirectory = None
_Generator__validateChanges = None
_Generator__writeForCustomization = None
_setImportAugmentableNamespaces(namespace_set)

Return the set of namespaces that may be augmented by import directives.

_setModuleList(module_list)
_setNamespaceVisibilities(public, private)
_setNoLoadNamespaces(namespace_set)

Record the set of namespaces that should not be loaded from an archive.

The expectation is that any required entities in the namespace will be defined by loading schema.

addImportAugmentableNamespace(namespace)

Mark that the specified namespace may be imported by new bindings.

Normally namespaces that are available from archives are considered to be complete, and schema locations in import directives are ignored. Use this to indicate that the bindings being generated import new bindings.

Note that attempts to import schema that contributed to the archive will only be detected if the archive was generated from the same schemaLocation URI; if the archive was generated from a different source component definitions might conflict.

addLocationPrefixRewrite(prefix, substituent)

Add a rewrite entry for schema locations.

:param prefix : A text prefix that should be removed from schema location URIs.

:param substituent : The text prefix that should replace prefix as a prefix in a schema location URI.

addModuleName(module_name)

Add a module name corresponding to an entrypoint schema.

The namespace defined by the corresponding schema will be written to a binding using the given module name, adjusted by modulePrefix.

addNamespace(namespace)
addNoLoadNamespace(namespace)

Mark that the specified namespace should not be loaded from an archive.

Use this when you are generating bindings for an application that has a restricted profile of a namespace that would otherwise be read from an archive. Be aware that this removes any knowledge of any archive in which this namespace is present as a non-private member.

addSchema(schema)
addSchemaLocation(schema_location, converter=None)

Add the location of an entrypoint schema.

Parameters:schema_location – The location of the schema. This

should be a URL; if the schema location does not have a URL scheme (e.g., http:), it is assumed to be a file, and if it is not an absolute path is located relative to the schemaRoot.

Parameters:converter – Optional callable that will be invoked

with the generator instance and the schema location, and is expected to return a pyxb.xmlschema.structures.Schema instance. If absent, the contents of the location are converted directly.

Note:The converter argument derives from WSDL support: we

need to add to the sequence of schema locations a URI of something that will not parse as a schema, but does have inner material that can if treated properly. “Treated properly” may include having the archive path and other namespace manipulations configured before anything is done to it.

allowAbsentModule()

Indicates whether the code generator is permitted to process namespace for which no module path can be determined.

Use this only when generating bindings that will not be referenced by other bindings.

allowBuiltinGeneration()

Indicates whether bindings will be written for namespaces that are built-in to PyXB.

This must be enabled when building bindings for the XML, XMLSchema instance, and other built-in namespaces. Normally generation of these namespaces is inhibited lest it produce inconsistencies.

applyOptionValues(options, args=None)
archivePath()

A colon-separated list of paths from which namespace archives can be read.

The default path is the contents of the PYXB_ARCHIVE_PATH environment variable, or the standard path configured at installation time. Any file with the extension wxs found in one of these directories is examined to see whether it is a namespace archive.

archiveToFile()

Optional file into which the archive of namespaces will be written.

Subsequent generation actions can read pre-parsed namespaces from this file, and therefore reference the bindings that were built earlier rather than re-generating them.

The file name should normally end with wxs.

argAddLocationPrefixRewrite(prefix_rewrite)

Add a rewrite entry for schema locations.

Parameter values are strings of the form pfx=sub. The effect is that a schema location that begins with pfx is rewritten so that it instead begins with sub.

This applies to schemaLocation attributes in import and include elements. It may be used to convert absolute schema locations into relative ones to allow offline processing when all schema are available in a local directory. See schemaRoot.

argAddSchemaLocation(schema_location)

Add the location of an entrypoint schema. The provided value should be a URL; if it does not have a URL scheme (e.g., http:), it is assumed to be a file, and if it is not an absolute path is located relative to the schemaRoot.

assignModulePath(module_record, module_path=None)

Provide a Python module path for the module record.

This is the path by which the module bindings associated with module_record will be imported.

If a path had already been assigned to the module, it is left in place.

Parameters:
Returns:

module_record

bindingModules()
bindingRoot()

The directory path into which generated bindings will be written. :rtype: str

componentGraph()
componentOrder()
defaultNamespacePublic()

Indicates whether unmentioned namespaces will be public or private (default) in the archive.

A namespace is I{mentioned} if it is the target namespace of an entrypoint schema, or appears in a namespace visibility specification. I.e., this default applies only to namespaces that are modified as a result of including some schema, which is generally a local customization of something.

generateToFiles()
generationUID()

A unique identifier associated with this Generator instance.

This is an instance of pyxb.utils.utility.UniqueIdentifier. Its associated objects are pyxb.namespace.archive._SchemaOrigin instances, which identify schema that contribute to the definition of a namespace.

getCommandLineArgs()

Return a command line option sequence that could be used to construct an equivalent configuration.

Note:If you extend the option parser, as is done by

pyxbgen, this may not be able to reconstruct the correct command line.

importAugmentableNamespaces()

A list of namespaces for which new bindings are allowd.

locationPrefixRewriteMap()

Optional map to rewrite schema locations.

This applies only to the values of schemaLocation attributes in import and include elements. Its purpose is to convert remote or absolute schema locations into local or relative ones to allow offline processing when all schema are available in a local directory. See schemaRoot.

loggingConfigFile()

A file provided to logging.config.fileConfig to control log messages.

In the absence of other configuration the Python standard logging infrastructure is used in its default configuration.

Return type:str
moduleForComponent(component)
moduleList()

A list of module names to be applied in order to the namespaces of entrypoint schemas

modulePathData(module)
modulePrefix()

The prefix for binding modules.

The base name for the module holding a binding is taken from the moduleList, moduleMap, or an XMLNS prefix associated with the namespace in a containing schema. This value, if present, is used as a prefix to allow a deeper module hierarchy.

moduleRecords()

The set of pyxb.namespace.archive.ModuleRecord instances associated with schema processed in this generation instance.

These should be in one-to-one correspondence with the namespaces for which bindings are being generated. Multiple input schemas may contribute to a single module record; all material in that record is placed in a single binding file.

namespaceModuleMap()

A map from namespace URIs to the module to be used for the corresponding generated binding.

Module values are adjusted by modulePrefix if that has been specified.

An entry in this map for a namespace supersedes the module specified in moduleList if the namespace is defined by an entrypoint schema.

Returns:A reference to the namespace module map.
namespaceVisibilityMap()

Indicates, for specific namespaces, whether their visibility in the archive should be public or private.

namespaces()

The set of namespaces for which bindings will be generated.

This is the set of namespaces read from entrypoint schema, closed under reference to namespaces defined by schema import.

Return type:set
noLoadNamespaces()

A frozenset of namespaces that must not be loaded from an archive.

normalizeSchemaLocation(sl)
optionParser(reset=False)

Return an optparse.OptionParser instance tied to this configuration.

Parameters:reset – If False (default), a parser created in a

previous invocation will be returned. If True, any previous option parser is discarded and a new one created. :type reset: bool

resolveExternalSchema()
schemaLocationList()

A list of locations from which entrypoint schemas are to be read.

The values in the list are either URIs, or tuples consisting of a value and a callable which, when passed the generator object and the value, will return a pyxb.xmlschema.structures.Schema instance. See addSchemaLocation.

See also addSchemaLocation and schemas.

schemaRoot()

The directory from which entrypoint schemas specified as relative file paths will be read.

schemaStrippedPrefix()

Optional string that is stripped from the beginning of schemaLocation values before loading from them. This now applies only to URIs specified on the command line so is unlikely to be useful.

schemas()

Schema for which bindings should be generated.

These may be Schema instances, or strings; the latter is preferred, and is parsed into a Schema instance when required.

This is the list of entrypoint schemas for binding generation. Values in schemaLocationList are read and converted into schema, then appended to this list. Values from moduleList are applied starting with the first schema in this list.

setAllowAbsentModule(allow_absent_module)
setAllowBuiltinGeneration(allow_builtin_generation)
setArchivePath(archive_path)
setArchiveToFile(archive_to_file)
setBindingRoot(binding_root)
setDefaultNamespacePublic(default_namespace_public)
setFromCommandLine(argv=None)
setLocationPrefixRewriteMap(location_prefix_rewrite_map)
setLoggingConfigFile(logging_config_file)
setModulePrefix(module_prefix)
setNamespaceVisibility(namespace, visibility)
setNamespaces(namespace_set)
setSchemaLocationList(schema_location_list)
setSchemaRoot(schema_root)
setSchemaStrippedPrefix(schema_stripped_prefix)
setSchemas(schemas)
setUriContentArchiveDirectory(ucad)
setValidateChanges(validate_changes)
setWriteForCustomization(write_for_customization)
uriContentArchiveDirectory()

The directory path into which any content retrieved by URI will be written.

This serves as a local cache, and to give you an opportunity to inspect material retrieved from some other system. :rtype: str

validateChanges()

Indicates whether the bindings should validate mutations against the content model.

writeForCustomization()

Indicates whether the binding Python code should be written into a sub-module for customization.

If enabled, a module path.to.namespace will be written to the file path/to/raw/namespace.py, so that the file path/to/namespace.py can import it and override behavior.

writeNamespaceArchive()
class pyxb.binding.generate.NamespaceGroupModule(generator, namespace_modules, **kw)

Bases: pyxb.binding.generate._ModuleNaming_mixin

This class represents a Python module that holds all the declarations belonging to a set of namespaces which have interdependencies.

_GroupPrefix = '_group'
_NamespaceGroupModule__UniqueInGroups = set([])
_NamespaceGroupModule__componentBindingName = None
_NamespaceGroupModule__components = None
_NamespaceGroupModule__namespaceModules = None
_NamespaceGroupModule__uniqueInModule = None
_bindingPreface_vx()
_bindingTagPrefix_vx()
_finalizeModuleContents_vx(template_map)
_initialBindingTemplateMap()
_moduleUID_vx()
moduleForNamespace(namespace)
namespaceModules()
class pyxb.binding.generate.NamespaceModule(generator, module_record, mr_scc, components=None, **kw)

Bases: pyxb.binding.generate._ModuleNaming_mixin

This class represents a Python module that holds all the declarations belonging to a specific namespace.

classmethod ForComponent(component)
_NamespaceModule__ComponentModuleMap = {}
_NamespaceModule__componentBindingName = None
_NamespaceModule__components = None
_NamespaceModule__moduleRecord = None
_NamespaceModule__namespace = None
_NamespaceModule__namespaceGroup = None
_NamespaceModule__namespaceGroupHead = None
_NamespaceModule__namespaceGroupModule = None
_UniqueInModule = set(['sys', '_module_typeBindings', 'CreateFromDOM', 'CreateFromDocument', 'pyxb'])
_bindingPreface_vx()
_bindingTagPrefix_vx()
_finalizeModuleContents_vx(template_map)
_initialBindingTemplateMap()
_moduleUID_vx()
bindComponent(component)
componentsInNamespace()
moduleRecord()
namespace()
namespaceGroupHead()
namespaceGroupModule()
namespaceGroupMulti()
setNamespaceGroupModule(namespace_group_module)
pyxb.binding.generate.PrefixModule(value, text=None)
class pyxb.binding.generate.ReferenceEnumerationMember(**kw)

Bases: pyxb.binding.generate.ReferenceLiteral

enumerationElement = None
class pyxb.binding.generate.ReferenceExpandedName(**kw)

Bases: pyxb.binding.generate.ReferenceLiteral

_ReferenceExpandedName__expandedName = None
class pyxb.binding.generate.ReferenceFacet(**kw)

Bases: pyxb.binding.generate.ReferenceLiteral

_ReferenceFacet__facet = None
class pyxb.binding.generate.ReferenceFacetMember(**kw)

Bases: pyxb.binding.generate.ReferenceLiteral

_ReferenceFacetMember__facetClass = None
class pyxb.binding.generate.ReferenceLiteral(**kw)

Bases: object

Base class for something that requires fairly complex activity in order to generate its literal value.

_ReferenceLiteral__literal = None
_ReferenceLiteral__ownerClass = None
_addTypePrefix(text, **kw)
asLiteral()
setLiteral(literal)
class pyxb.binding.generate.ReferenceNamespace(**kw)

Bases: pyxb.binding.generate.ReferenceLiteral

_ReferenceNamespace__namespace = None
class pyxb.binding.generate.ReferenceSchemaComponent(component, **kw)

Bases: pyxb.binding.generate.ReferenceLiteral

_ReferenceSchemaComponent__component = None
class pyxb.binding.generate.ReferenceWildcard(wildcard, **kw)

Bases: pyxb.binding.generate.ReferenceLiteral

_ReferenceWildcard__wildcard = None
class pyxb.binding.generate._CTDAuxData(ctd)

Bases: object

Helper class holding information need in both preparation and generation.

classmethod Create(ctd)
classmethod Get(ctd)
automaton = None
contentBasis = None
ctd = None
edMultiples = None
edSingles = None
termTree = None
pyxb.binding.generate._GenerateAutomaton(automaton, template_map, containing_state, lines, **kw)
class pyxb.binding.generate._ModuleNaming_mixin(generator, *args, **kw)

Bases: object

classmethod BindComponentInModule(component, module)
classmethod ComponentBindingModule(component)
classmethod _ForRecord(module_record)
_ModuleNaming_mixin__ComponentBindingModuleMap = {}
_ModuleNaming_mixin__RecordModuleMap = {}
_ModuleNaming_mixin__anonCTDIndex = None
_ModuleNaming_mixin__anonSTDIndex = None
_ModuleNaming_mixin__bindingFile = None
_ModuleNaming_mixin__bindingFilePath = None
_ModuleNaming_mixin__generator = None
_ModuleNaming_mixin__modulePath = None
_ModuleNaming_mixin__moduleUID = None
_ModuleNaming_mixin__referencedFromClass = None
_ModuleNaming_mixin__referencedNamespaces = None
_ModuleNaming_mixin__uniqueInClass = None
_ModuleNaming_mixin__uniqueInModule = None
classmethod _RecordModule(module)
_ReferencedFromClass = set(['sys', '_module_typeBindings', 'pyxb'])

Identifiers defined in module that are accessed unqualified from class.

These include standard import module names and globals such as references to namespaces.

_UniqueInModule = set(['sys', '_module_typeBindings', 'pyxb'])

Identifiers that are reserved within a module.

Subclasses extend this with the identifiers they add to the module. Module-level schema-derived identifiers (such as type definition and element names) are deconflicted from this set and from each other.

_bindComponent(component)
_bindingPreface_vx()
_bindingTagPrefix_vx()
_importModule(module)
_initializeUniqueInModule(unique_in_module)
_moduleUID_vx()
_referencedNamespaces()
_setModulePath(path_data)
addImportsFrom(module)
bindingFile()
bindingIO()
bindingPreface()

Return a block of binding text (comment or code) serving as a preface.

Normally this should describe the module contents.

bindingTag()

Return a distinct string recorded in the first 4096 bytes of the binding file.

This is used to ensure uniqueness and avoid overwriting data belonging to a different binding. The return value comprises the class-specialized _bindingTagPrefix_vx with the moduleUID.

defineNamespace(namespace, name, definition=None, **kw)
generator()
importForDeclaration(decl)

Import the binding from which the declaration came.

Figure out where the declaration came from. If it’s not part of this binding, make sure we import the binding associated with the schema from which it came. We need that, if not for something in the declaration itself, at least to be able to get the Namespace for the declaration’s name. None of this is relevant if the declaration has no namespace.

literal(*args, **kw)
moduleContents()
modulePath()
moduleUID()
nameInModule(component)
pathFromImport(module, name)

Python code reference to an object in an imported module

referenceNamespace(namespace)
referenceSchemaComponent(component, in_class=False)
uniqueInClass(component)
uniqueInModule()
writeToModuleFile()
pyxb.binding.generate._PrepareComplexTypeDefinition(ctd, generator, nsm, module_context)
pyxb.binding.generate._PrepareSimpleTypeDefinition(std, generator, nsm, module_context)
pyxb.binding.generate._SetNameWithAccessors(component, container, is_plural, binding_module, nsm, kw)
pyxb.binding.generate._VCAppendAuxInit(vc_source, aux_init, binding_module, kw)
pyxb.binding.generate._useEnumerationTags(td)
pyxb.binding.generate.elementDeclarationMap(ed, binding_module, **kw)
pyxb.binding.generate.pythonLiteral(value, **kw)
pyxb.binding.generate.simpleTypeOwnedEnumerationFacet(std)

pyxb.binding.saxer module

This module contains support for generating bindings from an XML stream using a SAX parser.

class pyxb.binding.saxer.PyXBSAXHandler(**kw)

Bases: pyxb.utils.saxutils.BaseSAXHandler

A SAX handler class which generates a binding instance for a document through a streaming parser.

An example of using this to parse the document held in the (unicode) text value xmlt is:

import pyxb.binding.saxer
import io

saxer = pyxb.binding.saxer.make_parser()
handler = saxer.getContentHandler()
saxer.parse(io.StringIO(xmlt))
instance = handler.rootObject()
_PyXBSAXHandler__XSITypeTuple = ('http://www.w3.org/2001/XMLSchema-instance', 'type')
_PyXBSAXHandler__domDepth = None
_PyXBSAXHandler__domHandler = None
_PyXBSAXHandler__rootObject = None
_PyXBSAXHandler__trace = False
endElementNS(name, qname)
reset()

Reset the state of the handler in preparation for processing a new document.

Returns:self
rootObject()

Return the binding object corresponding to the top-most element in the document

Returns:An instance of basis._TypeBinding_mixin (most usually a

basis.complexTypeDefinition.

Raises:pyxb.[UnrecognizedDOMRootNodeError – No binding could be found to

match the top-level element in the document.

startElementNS(name, qname, attrs)
class pyxb.binding.saxer._SAXElementState(**kw)

Bases: pyxb.utils.saxutils.SAXElementState

State required to generate bindings for a specific element.

If the document being parsed includes references to unrecognized elements, a DOM instance of the element and its content is created and treated as a wildcard element.

_SAXElementState__XSINilTuple = ('http://www.w3.org/2001/XMLSchema-instance', 'nil')
_SAXElementState__attributes = None
_SAXElementState__bindingInstance = None
_SAXElementState__constructElement(new_object_factory, attrs, content=None)
_SAXElementState__delayedConstructor = None
_SAXElementState__domDepth = None
_SAXElementState__domDocument = None
_SAXElementState__elementBinding = None
_SAXElementState__enclosingCTD = None
enclosingCTD()

The nearest enclosing complex type definition, as used for resolving local element/attribute names.

Returns:An instance of basis.complexTypeDefinition, or None if

the element is top-level

endBindingElement()

Perform any end-of-element processing.

For simple type instances, this creates the binding instance. :return: The generated binding instance

endDOMElement()

Actions upon leaving an element that is part of a DOM subtree.

enterDOMMode(attrs)

Actions upon first encountering an element for which we cannot create a binding.

Invoking this transitions the parser into DOM mode, creating a new DOM document that will represent this element including its content.

inDOMMode()
setElementBinding(element_binding)

Record the binding to be used for this element.

Generally ignored, except at the top level this is the only way to associate a binding instance created from an xsi:type description with a specific element.

setEnclosingCTD(enclosing_ctd)

Set the enclosing complex type definition for this element.

Parameters:enclosing_ctd (basis.complexTypeDefinition) – The scope for a local element.
Returns:self
startBindingElement(type_class, new_object_factory, element_decl, attrs)

Actions upon entering an element that will produce a binding instance.

The element use is recorded. If the type is a subclass of basis.simpleTypeDefinition, a delayed constructor is recorded so the binding instance can be created upon completion of the element; otherwise, a binding instance is created and stored. The attributes are used to initialize the binding instance (now, or upon element end).

Parameters:
  • type_class (subclass of basis._TypeBinding_mixin) – The Python type of the binding instance
  • new_object_factory – A callable object that creates an instance of the type_class
  • element_decl (basis.element) – The element use with which the binding instance is associated. Will be None for top-level elements
  • attrs (xml.sax.xmlreader.Attributes) – The XML attributes associated with the element
Returns:

The generated binding instance, or None if creation is delayed

startDOMElement(attrs)

Actions upon entering an element that is part of a DOM subtree.

pyxb.binding.saxer.make_parser(*args, **kw)

Extend pyxb.utils.saxutils.make_parser to change the default content_handler_constructor to be PyXBSAXHandler.

pyxb.binding.xml_ module

Binding classes for types referenced by the attribute and attribute group declarations in the XML namespace (http://www.w3.org/XML/1998/namespace).

The content of this module was generated by PyXB and is coupled to the components defined in pyxb.namespace.builtin._XML.

class pyxb.binding.xml_.STD_ANON_emptyString(*args, **kw)

Bases: pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin

No information

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_ExpandedName = None
_STD_ANON_emptyString_FacetMap = {<class 'pyxb.binding.facets.CF_length'>: <pyxb.binding.facets.CF_length object>, <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_whiteSpace object>, <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_minLength'>: <pyxb.binding.facets.CF_minLength object>, <class 'pyxb.binding.facets.CF_maxLength'>: <pyxb.binding.facets.CF_maxLength object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
emptyString = u''
class pyxb.binding.xml_.STD_ANON_lang(*args, **kw)

Bases: pyxb.binding.basis.STD_union

Simple type that is a union of pyxb.binding.datatypes.language, STD_ANON_emptyString

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_CF_pattern = <pyxb.binding.facets.CF_pattern object>
_ExpandedName = None
_MemberTypes = (<class 'pyxb.binding.datatypes.language'>, <class 'pyxb.binding.xml_.STD_ANON_emptyString'>)
_STD_ANON_lang_FacetMap = {<class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
_STD_ANON_lang__SimpleTypeDefinition = <pyxb.xmlschema.structures.SimpleTypeDefinition object>
class pyxb.binding.xml_.STD_ANON_space(*args, **kw)

Bases: pyxb.binding.datatypes.NCName, pyxb.binding.basis.enumeration_mixin

No information

_CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
_ExpandedName = None
_STD_ANON_space_FacetMap = {<class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF_enumeration object>, <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pattern object>}
_STD_ANON_space__SimpleTypeDefinition = <pyxb.xmlschema.structures.SimpleTypeDefinition object>
default = u'default'
preserve = u'preserve'

Module contents

Material used to generate and execute bindings generated by the PyXB package.