Public Member Functions | |
def | __init__ |
def | characters |
def | endElement |
def | root |
def | startElement |
def | topLevel |
Public Attributes | |
current | |
Static Public Attributes | |
tuple | non_id_char = re.compile('[^_0-9a-zA-Z]') |
Private Member Functions | |
def | _name_mangle |
Private Attributes | |
_ncDict | |
_root | |
_stack | |
_text_parts |
Definition at line 65 of file XML2Python.py.
def python::XML2Python::TreeBuilder::__init__ | ( | self, | |
kwargs | |||
) |
Definition at line 69 of file XML2Python.py.
def python::XML2Python::TreeBuilder::_name_mangle | ( | name | ) | [private] |
Definition at line 108 of file XML2Python.py.
def python::XML2Python::TreeBuilder::characters | ( | self, | |
content | |||
) |
Definition at line 96 of file XML2Python.py.
def python::XML2Python::TreeBuilder::endElement | ( | self, | |
name | |||
) |
Definition at line 84 of file XML2Python.py.
00085 : 00086 text = ''.join (self._text_parts).strip() 00087 if text: 00088 self.current._data = text 00089 if self.current.attributes(): 00090 obj = self.current 00091 else: 00092 # a text only node is simply represented by the string 00093 obj = text or '' 00094 self.current, self._text_parts = self._stack.pop() 00095 self.current._add_xml_attr (TreeBuilder._name_mangle(name), obj)
def python::XML2Python::TreeBuilder::root | ( | self | ) |
Definition at line 99 of file XML2Python.py.
def python::XML2Python::TreeBuilder::startElement | ( | self, | |
name, | |||
attrs | |||
) |
Definition at line 76 of file XML2Python.py.
00077 : 00078 self._stack.append( (self.current, self._text_parts)) 00079 self.current = DataNode (nameChangeDict = self._ncDict) 00080 self._text_parts = [] 00081 # xml attributes --> python attributes 00082 for k, v in attrs.items(): 00083 self.current._add_xml_attr (TreeBuilder._name_mangle(k), v)
def python::XML2Python::TreeBuilder::topLevel | ( | self | ) |
Returns top level object
Definition at line 102 of file XML2Python.py.
python::XML2Python::TreeBuilder::_ncDict [private] |
Definition at line 69 of file XML2Python.py.
python::XML2Python::TreeBuilder::_root [private] |
Definition at line 69 of file XML2Python.py.
python::XML2Python::TreeBuilder::_stack [private] |
Definition at line 69 of file XML2Python.py.
Definition at line 69 of file XML2Python.py.
Definition at line 69 of file XML2Python.py.
tuple python::XML2Python::TreeBuilder::non_id_char = re.compile('[^_0-9a-zA-Z]') [static] |
Definition at line 67 of file XML2Python.py.