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

# type _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) | 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`

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

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
Overrides: utils.saxutils.SAXElementState.__init__

### setEnclosingCTD(self, enclosing_ctd) | source code
Set the enclosing complex type definition for this element. Parameters: `enclosing_ctd` (basis.complexTypeDefinition) - The scope for a local element. 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')