RPKI Engine  1.0
Public Member Functions | Public Attributes
rpki::xml_utils::sax_handler Class Reference
Inheritance diagram for rpki::xml_utils::sax_handler:
Inheritance graph
Collaboration diagram for rpki::xml_utils::sax_handler:
Collaboration 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 38 of file xml_utils.py.


Constructor & Destructor Documentation

def rpki::xml_utils::sax_handler::__init__ (   self)
Initialize SAX handler.

Definition at line 53 of file xml_utils.py.


Member Function Documentation

def rpki::xml_utils::sax_handler::characters (   self,
  content 
)
Accumulate a chuck of element content (text).

Definition at line 73 of file xml_utils.py.

References text.

def rpki::xml_utils::sax_handler::create_top_level (   self,
  name,
  attrs 
)
def rpki::xml_utils::sax_handler::endElement (   self,
  name 
)
Handle endElement() events.  Mostly this means handling any
accumulated element text.

Definition at line 107 of file xml_utils.py.

References stack, and text.

Referenced by endElementNS().

Here is the caller graph for this function:

def rpki::xml_utils::sax_handler::endElementNS (   self,
  name,
  qname 
)
def rpki::xml_utils::sax_handler::saxify (   cls,
  elt 
)
Create a one-off SAX parser, parse an ETree, return the result.

Definition at line 117 of file xml_utils.py.

References result, and rpki::adns::getaddrinfo::result.

Referenced by rpki::x509::XML_CMS_object::unwrap().

Here is the caller graph for this function:

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 79 of file xml_utils.py.

Referenced by startElementNS().

Here is the caller graph for this function:

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

Member Data Documentation

Definition at line 89 of file xml_utils.py.

Referenced by saxify().

Definition at line 55 of file xml_utils.py.

Referenced by endElement().

Definition at line 55 of file xml_utils.py.

Referenced by characters(), and endElement().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties