Package pyxb :: Package binding :: Module saxer :: Class _SAXElementState
[hide private]
[frames] | no frames]

Class _SAXElementState

source code

                    object --+    
                             |    
utils.saxutils.SAXElementState --+
                                 |
                                _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.

Instance Methods [hide private]
 
setElementBinding(self, element_binding)
Record the binding to be used for this element.
source code
 
enclosingCTD(self)
The nearest enclosing complex type definition, as used for resolving local element/attribute names.
source code
 
__init__(self, **kw)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
setEnclosingCTD(self, enclosing_ctd)
Set the enclosing complex type definition for this element.
source code
 
__constructElement(self, new_object_factory, attrs, content=None) source code
 
inDOMMode(self) source code
 
enterDOMMode(self, attrs)
Actions upon first encountering an element for which we cannot create a binding.
source code
 
startDOMElement(self, attrs)
Actions upon entering an element that is part of a DOM subtree.
source code
 
endDOMElement(self)
Actions upon leaving an element that is part of a DOM subtree.
source code
 
startBindingElement(self, type_class, new_object_factory, element_decl, attrs)
Actions upon entering an element that will produce a binding instance.
source code
 
endBindingElement(self)
Perform any end-of-element processing.
source code
 
_SAXElementState__constructElement(self, new_object_factory, attrs, content=None) source code

Inherited from utils.saxutils.SAXElementState: addElementContent, addTextContent, content, contentHandler, expandedName, location, namespaceContext, parentState

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

Class Variables [hide private]
  __XSINilTuple = XSI.nil.uriTuple()
  __bindingInstance = None
hash(x)
  __elementBinding = None
hash(x)
  __enclosingCTD = None
hash(x)
  __delayedConstructor = None
hash(x)
  __attributes = None
hash(x)
  __domDocument = None
hash(x)
  __domDepth = None
hash(x)
  _SAXElementState__XSINilTuple = ('http://www.w3.org/2001/XMLSc...
  _SAXElementState__attributes = None
hash(x)
  _SAXElementState__bindingInstance = None
hash(x)
  _SAXElementState__delayedConstructor = None
hash(x)
  _SAXElementState__domDepth = None
hash(x)
  _SAXElementState__domDocument = None
hash(x)
  _SAXElementState__elementBinding = None
hash(x)
  _SAXElementState__enclosingCTD = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setElementBinding(self, element_binding)

source code 

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.

enclosingCTD(self)

source code 

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

__init__(self, **kw)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setEnclosingCTD(self, enclosing_ctd)

source code 

Set the enclosing complex type definition for this element.

Parameters:
Returns:
self

enterDOMMode(self, attrs)

source code 

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.

startBindingElement(self, type_class, new_object_factory, element_decl, attrs)

source code 

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

endBindingElement(self)

source code 

Perform any end-of-element processing.

For simple type instances, this creates the binding instance.

Returns:
The generated binding instance

Class Variable Details [hide private]

_SAXElementState__XSINilTuple

Value:
('http://www.w3.org/2001/XMLSchema-instance', 'nil')