Package pyxb :: Package namespace :: Module builtin :: Class _XMLSchema_instance
[hide private]
[frames] | no frames]

Class _XMLSchema_instance

source code

                       object --+            
                                |            
                          cscRoot --+        
                                    |        
             _NamespaceCategory_mixin --+    
                                        |    
                       object --+       |    
                                |       |    
                          cscRoot --+   |    
                                    |   |    
resolution._NamespaceResolution_mixin --+    
                                        |    
                       object --+       |    
                                |       |    
                          cscRoot --+   |    
                                    |   |    
 _NamespaceComponentAssociation_mixin --+    
                                        |    
                       object --+       |    
                                |       |    
                          cscRoot --+   |    
                                    |   |    
   archive._NamespaceArchivable_mixin --+    
                                        |    
                                Namespace --+
                                            |
                                           _XMLSchema_instance

Extension of Namespace that pre-defines components available in the XMLSchema Instance namespace.

Instance Methods [hide private]
 
__init__(self, *args, **kw)
Create a new Namespace.
source code
 
ProcessTypeAttribute(self, value=None)
Specify how PyXB should interpret xsi:type attributes when converting a document to a binding instance.
source code
 
_InterpretTypeAttribute(self, type_name, ns_ctx, fallback_namespace, type_class)
Interpret the value of an xsi:type attribute as configured.
source code
 
_defineBuiltins_ox(self, structures_module)
Ensure this namespace is ready for use.
source code

Inherited from Namespace: __getnewargs__, __getstate__, __str__, boundPrefix, builtinModulePath, builtinNamespaceRepresentation, createExpandedName, description, fallbackNamespace, hasBeenArchived, initialNamespaceContext, isAbsentNamespace, isBuiltinNamespace, isLoadedNamespace, isUndeclaredNamespace, nodeIsNamed, prefix, setPrefix, uri, validateComponentModel

Inherited from _NamespaceCategory_mixin: addCategoryObject, categories, categoryMap, configureCategories, hasSchemaComponents, replaceCategoryObject

Inherited from resolution._NamespaceResolution_mixin: importNamespace, importedNamespaces, needsResolution, queueForResolution, referencedNamespaces, resolveDefinitions

Inherited from _NamespaceComponentAssociation_mixin: addSchema, components, lookupSchemaByLocation, schemas

Inherited from archive._NamespaceArchivable_mixin: addModuleRecord, isActive, isLoadable, loadableFrom, lookupModuleRecordByUID, markNotLoadable, moduleRecords

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from Namespace: AvailableNamespaces, CreateAbsentNamespace

Inherited from Namespace (private): _NamespaceForURI

Static Methods [hide private]

Inherited from Namespace: __new__

Class Variables [hide private]
  PT_strict = 'strict'
xsi:type is validated and supersedes the declared type.
  PT_lax = 'lax'
xsi:type supersedes the declared type without validation.
  PT_skip = 'skip'
xsi:type attributes are ignored.
  __processType = 'strict'
  type = None
An expanded name for {http://www.w3.org/2001/XMLSchema-instance}type.
  nil = None
An expanded name for {http://www.w3.org/2001/XMLSchema-instance}nil.
  _XMLSchema_instance__processType = 'strict'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kw)
(Constructor)

source code 

Create a new Namespace.

The URI must be non-None, and must not already be assigned to a Namespace instance. See NamespaceForURI().

User-created Namespace instances may also provide a description.

Users should never provide a builtin_namespace parameter.

Overrides: object.__init__
(inherited documentation)

ProcessTypeAttribute(self, value=None)

source code 

Specify how PyXB should interpret xsi:type attributes when converting a document to a binding instance.

The default value is PT_strict.

xsi:type should only be provided when using an abstract class, or a concrete class that happens to be the same as the xsi:type value, or when accepting a wildcard that has an unrecognized element name. In practice, web services tend to set it on nodes just to inform their lax-processing clients how to interpret the value.

Parameters:
Returns:
The current configuration for processing xsi:type attributes

_InterpretTypeAttribute(self, type_name, ns_ctx, fallback_namespace, type_class)

source code 

Interpret the value of an xsi:type attribute as configured.

Parameters:
  • type_name - The QName value from the attribute
  • ns_ctx - The NamespaceContext within which the type_name should be resolved
  • fallback_namespace - The namespace that should be used if the type name has no prefix
  • type_class - The value to return if the type name is missing or acceptably invalid @raises pyxb.BadDocumentError: if the processing type configuration is PT_strict and the type name fails to resolve to a type definition that is consistent with any provided type_class.

_defineBuiltins_ox(self, structures_module)

source code 

Ensure this namespace is ready for use.

Overrides base class implementation, since there is no schema for this namespace.

Overrides: Namespace._defineBuiltins_ox

Class Variable Details [hide private]

PT_strict

xsi:type is validated and supersedes the declared type. If no xsi:type is present, the declared element type will be used. If xsi:type is present, it must resolve to valid type. The resolved type must be a subclass of the declared type (if available), and will be used for the binding.

Value:
'strict'

PT_lax

xsi:type supersedes the declared type without validation. If no xsi:type is present, or it is present and fails to resolve to a type, the declared element type will be used. If xsi:type is present and resolves to valid type, that type will be used for the binding, even if it is not a subclass of the declared type.

Value:
'lax'

PT_skip

xsi:type attributes are ignored. The declared element type will be used.

Value:
'skip'