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

Class PyXBSAXHandler

source code

xml.sax.handler.ContentHandler --+    
                                 |    
                        object --+    
                                 |    
     utils.saxutils.BaseSAXHandler --+
                                     |
                                    PyXBSAXHandler

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 string xmls is:

 import pyxb.binding.saxer
 import StringIO

 saxer = pyxb.binding.saxer.make_parser()
 handler = saxer.getContentHandler()
 saxer.parse(StringIO.StringIO(xml))
 instance = handler.rootObject()
Instance Methods [hide private]
 
rootObject(self)
Return the binding object corresponding to the top-most element in the document
source code
 
reset(self)
Reset the state of the handler in preparation for processing a new document.
source code
 
__init__(self, **kw)
Create a parser instance for converting XML to bindings.
source code
 
startElementNS(self, name, qname, attrs)
Process the start of an element.
source code
 
endElementNS(self, name, qname)
Process the completion of an element.
source code

Inherited from utils.saxutils.BaseSAXHandler: characters, elementState, fallbackNamespace, ignorableWhitespace, namespaceContext, processingInstruction, setDocumentLocator, startDocument, startPrefixMapping

Inherited from xml.sax.handler.ContentHandler: endDocument, endElement, endPrefixMapping, skippedEntity, startElement

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

Class Variables [hide private]
  __trace = False
  __XSITypeTuple = ('http://www.w3.org/2001/XMLSchema-instance',...
  __domHandler = None
hash(x)
  __domDepth = None
hash(x)
  __rootObject = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

rootObject(self)

source code 

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:
Overrides: utils.saxutils.BaseSAXHandler.rootObject

reset(self)

source code 

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

Returns:
self
Overrides: utils.saxutils.BaseSAXHandler.reset

__init__(self, **kw)
(Constructor)

source code 

Create a parser instance for converting XML to bindings.

Parameters:
Overrides: object.__init__

startElementNS(self, name, qname, attrs)

source code 

Process the start of an element.

Overrides: xml.sax.handler.ContentHandler.startElementNS
(inherited documentation)

endElementNS(self, name, qname)

source code 

Process the completion of an element.

Overrides: xml.sax.handler.ContentHandler.endElementNS
(inherited documentation)

Class Variable Details [hide private]

__XSITypeTuple

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