Public Member Functions | |
def | __init__ |
def | __init__ |
def | characters |
def | characters |
def | endElement |
def | endElement |
def | root |
def | root |
def | startElement |
def | startElement |
def | topLevel |
def | topLevel |
Public Attributes | |
current | |
Static Public Attributes | |
tuple | non_id_char = re.compile('[^_0-9a-zA-Z]') |
Private Member Functions | |
def | _name_mangle |
def | _name_mangle |
Private Attributes | |
_ncDict | |
_root | |
_stack | |
_text_parts |
Definition at line 159 of file XML2Python.py.
def XML2Python::TreeBuilder::__init__ | ( | self, | |
kwargs | |||
) |
Definition at line 163 of file XML2Python.py.
def XML2Python::TreeBuilder::__init__ | ( | self, | |
kwargs | |||
) |
Definition at line 69 of file XML2Python.py.
def XML2Python::TreeBuilder::_name_mangle | ( | name | ) | [private] |
Definition at line 202 of file XML2Python.py.
def XML2Python::TreeBuilder::_name_mangle | ( | name | ) | [private] |
Definition at line 108 of file XML2Python.py.
def XML2Python::TreeBuilder::characters | ( | self, | |
content | |||
) |
Definition at line 96 of file XML2Python.py.
def XML2Python::TreeBuilder::characters | ( | self, | |
content | |||
) |
Definition at line 190 of file XML2Python.py.
def 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 XML2Python::TreeBuilder::endElement | ( | self, | |
name | |||
) |
Definition at line 178 of file XML2Python.py.
00179 : 00180 text = ''.join (self._text_parts).strip() 00181 if text: 00182 self.current._data = text 00183 if self.current.attributes(): 00184 obj = self.current 00185 else: 00186 # a text only node is simply represented by the string 00187 obj = text or '' 00188 self.current, self._text_parts = self._stack.pop() 00189 self.current._add_xml_attr (TreeBuilder._name_mangle(name), obj)
def XML2Python::TreeBuilder::root | ( | self | ) |
Definition at line 193 of file XML2Python.py.
def XML2Python::TreeBuilder::root | ( | self | ) |
Definition at line 99 of file XML2Python.py.
def XML2Python::TreeBuilder::startElement | ( | self, | |
name, | |||
attrs | |||
) |
Definition at line 170 of file XML2Python.py.
00171 : 00172 self._stack.append( (self.current, self._text_parts)) 00173 self.current = DataNode (nameChangeDict = self._ncDict) 00174 self._text_parts = [] 00175 # xml attributes --> python attributes 00176 for k, v in attrs.items(): 00177 self.current._add_xml_attr (TreeBuilder._name_mangle(k), v)
def 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 XML2Python::TreeBuilder::topLevel | ( | self | ) |
Returns top level object
Definition at line 196 of file XML2Python.py.
def XML2Python::TreeBuilder::topLevel | ( | self | ) |
Returns top level object
Definition at line 102 of file XML2Python.py.
XML2Python::TreeBuilder::_ncDict [private] |
Definition at line 163 of file XML2Python.py.
XML2Python::TreeBuilder::_root [private] |
Definition at line 163 of file XML2Python.py.
XML2Python::TreeBuilder::_stack [private] |
Definition at line 163 of file XML2Python.py.
XML2Python::TreeBuilder::_text_parts [private] |
Definition at line 163 of file XML2Python.py.
Definition at line 163 of file XML2Python.py.
tuple XML2Python::TreeBuilder::non_id_char = re.compile('[^_0-9a-zA-Z]') [static] |
Definition at line 161 of file XML2Python.py.