Python Package
>> xml.etree.ElementTree, v
source: lib/xml/etree/ElementTree.py
Reference>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Functions<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>> xml.etree.ElementTree.Comment(text=None)
Comment element factory
return Element instance
>> xml.etree.ElementTree.dump(elem)
write to sys.stdout
>> xml.etree.ElementTree.fromstring(text)
same as XML()
return Elment instance
>> xml.etree.ElementTree.fromstringlist(sequence, parser=None)
standard parser XMLParser
return Element instance
>> xml.etree.ElementTree.iselement(elem)
return bool
>> xml.etree.ElementTree.iterparse(source, events=None, parser=None)
standard parser XMLParser
return iterator (event, elem) pairs
>> xml.etree.ElementTree.parse(src, parser=None)
return ElementTree instance
>> xml.etree.ElementTree.ProcessingInstruction(target, text=None)
PI element factory
return Element instance
>> xml.etree.ElementTree.register_namespace(prefix, uri)
>> xml.etree.ElementTree.SubElement(parent, tag, attrib={}, **extra)
Subelement factory
return Element instance
>> xml.etree.ElementTree.tostring(elem, encoding='us-ascii', method='xml')
method: xml/defualt, html, text
return string
>> xml.etree.ElementTree.tostringlist(elem, encoding='us-ascii', method='xml')
return string list
>> xml.etree.ElementTree.XML(text, parser=None)
return Element instance
>> xml.etree.ElementTree.XMLID(text, parser=None)
return tuple, containing Element instance and dictionary
Element Objects>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>> class xml.etree.ElementTree.Element(tag, attrib={}, **extra)
# attributes
>> tag
>> text
>> tail
>> attrib
# methods
>> clear()
>> get(key, default=None)
>> items()
>> keys
>> set(key, value)
# methods working on subelem
>> append(subelem)
>> extend(subelems)
>> find(match)
>> findall(match)
>> findtext(match, default=None)
>! getchildren()
>! getiterator(tag=None)
>> insert(index, elem)
>> iter(tag=None), tag/None/*/..
>> iterfind(match)
>> itertext()
>! makeelement(tag, attrib)
>> remove(subelem)
>> sequence type methods
__delitem__()
__getitem__()
__setitem__()
__len__()
ElementTree Objects>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>> class xml.etree.ElementTree.ElementTree(elem=None, file=None)
>> _setroot(elem)
>> find(match)
>> findall(match)
>> findtext(match, defualt=None)
>! getiterator(tag=None)
>> getroot()
>> iter(tag=None)
>> iterfind(match)
>> parse(src, parser=None)
>> write(file, encoding='us-ascii', xml_declaration=None, method='xml')
QName Objects>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>> class xml.etree.ElementTree.QName(text_or_uri, tag=None)
QName wrapper
TreeBuilder Objects>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>> class xml.etree.ElementTree.TreeBuilder(elem_factory=None)
>> close()
>> data(data)
>> end(tag)
>> start(tag, attrs)
>- doctype(name, pubid, system)
XMLParser Objects>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>> class xml.etree.ElementTree.XMLParser(html=0, target=None, encoding=None)
>> close()
>! doctype(name, pubid, system)
>> feed(data)