rpki.xml_utils.sax_handler Class Reference

Inheritance diagram for rpki.xml_utils.sax_handler:

Inheritance graph

List of all members.

Public Member Functions

def __init__
def characters
def create_top_level
def endElement
def endElementNS
def saxify
def startElement
def startElementNS

Public Attributes

 result
 stack
 text


Detailed Description

SAX handler for RPKI protocols.

This class provides some basic amenities for parsing protocol XML of
the kind we use in the RPKI protocols, including whacking all the
protocol element text into US-ASCII, simplifying accumulation of
text fields, and hiding some of the fun relating to XML namespaces.

General assumption: by the time this parsing code gets invoked, the
XML has already passed RelaxNG validation, so we only have to check
for errors that the schema can't catch, and we don't have to play as
many XML namespace games.

Definition at line 22 of file xml_utils.py.


Member Function Documentation

def rpki.xml_utils.sax_handler.__init__ (   self  ) 

Initialize SAX handler.

Definition at line 36 of file xml_utils.py.

def rpki.xml_utils.sax_handler.characters (   self,
  content 
)

Accumulate a chuck of element content (text).

Definition at line 49 of file xml_utils.py.

def rpki.xml_utils.sax_handler.create_top_level (   self,
  name,
  attrs 
)

Handle top-level PDU for this protocol.

Definition at line 96 of file xml_utils.py.

def rpki.xml_utils.sax_handler.endElement (   self,
  name 
)

Handle endElement() events.

Mostly this means handling any accumulated element text.

Definition at line 79 of file xml_utils.py.

def rpki.xml_utils.sax_handler.endElementNS (   self,
  name,
  qname 
)

Redirect endElementNS() events to endElement().

Definition at line 45 of file xml_utils.py.

def rpki.xml_utils.sax_handler.saxify (   cls,
  elt 
)

Create a one-off SAX parser, parse an ETree, return the result.

Definition at line 89 of file xml_utils.py.

def rpki.xml_utils.sax_handler.startElement (   self,
  name,
  attrs 
)

Handle startElement() events.

We maintain a stack of nested elements under construction so that
we can feed events directly to the current element rather than
having to pass them through all the nesting elements.

If the stack is empty, this event is for the outermost element, so
we call a virtual method to create the corresponding object and
that's the object we'll be returning as our final result.

Definition at line 53 of file xml_utils.py.

def rpki.xml_utils.sax_handler.startElementNS (   self,
  name,
  qname,
  attrs 
)

Redirect startElementNS() events to startElement().

Definition at line 41 of file xml_utils.py.


Member Data Documentation

Definition at line 75 of file xml_utils.py.

Definition at line 39 of file xml_utils.py.

Definition at line 38 of file xml_utils.py.


The documentation for this class was generated from the following file:

Generated on Sat Jun 21 07:55:40 2008 for RPKI Engine by  doxygen 1.5.5