xml.etree.ElementTree
index
/astro-wise/awehome/Linux-fedora-6-x86_64/local/lib/python2.7/xml/etree/ElementTree.py
Module Docs

ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl   added tostringlist/fromstringlist helpers
# 2006-07-05 fl   merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl   removed support for 2.1 and earlier
# 2007-06-21 fl   added deprecation/future warnings
# 2007-08-25 fl   added doctype hook, added parser version attribute etc
# 2007-08-26 fl   added new serializer code (better namespace handling, etc)
# 2007-08-27 fl   warn for broken /tag searches on tree level
# 2007-09-02 fl   added html/text methods to serializer (experimental)
# 2007-09-05 fl   added method argument to tostring/tostringlist
# 2007-09-06 fl   improved error handling
# 2007-09-13 fl   added itertext, iterfind; assorted cleanups
# 2007-12-15 fl   added C14N hooks, copy method (experimental)
#
# Copyright (c) 1999-2008 by Fredrik Lundh.  All rights reserved.
#
# fredrik@pythonware.com
http://www.pythonware.com
#
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

 
Modules
       
xml.etree.ElementPath
re
sys
warnings

 
Classes
       
__builtin__.object
Element
ElementTree
QName
TreeBuilder
XMLParser
XMLParser
exceptions.SyntaxError(exceptions.StandardError)
ParseError

 
class Element(__builtin__.object)
     Methods defined here:
__delitem__(self, index)
__getitem__(self, index)
__init__(self, tag, attrib={}, **extra)
__len__(self)
__nonzero__(self)
__repr__(self)
__setitem__(self, index, element)
append(self, element)
clear(self)
copy(self)
extend(self, elements)
find(self, path, namespaces=None)
findall(self, path, namespaces=None)
findtext(self, path, default=None, namespaces=None)
get(self, key, default=None)
getchildren(self)
getiterator(self, tag=None)
# compatibility
insert(self, index, element)
items(self)
iter(self, tag=None)
iterfind(self, path, namespaces=None)
itertext(self)
keys(self)
makeelement(self, tag, attrib)
remove(self, element)
set(self, key, value)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
attrib = None
tag = None
tail = None
text = None

 
class ElementTree(__builtin__.object)
     Methods defined here:
__init__(self, element=None, file=None)
find(self, path, namespaces=None)
findall(self, path, namespaces=None)
findtext(self, path, default=None, namespaces=None)
getiterator(self, tag=None)
# compatibility
getroot(self)
iter(self, tag=None)
iterfind(self, path, namespaces=None)
parse(self, source, parser=None)
write(self, file_or_filename, encoding=None, xml_declaration=None, default_namespace=None, method=None)
write_c14n(self, file)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ParseError(exceptions.SyntaxError)
    
Method resolution order:
ParseError
exceptions.SyntaxError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.SyntaxError:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.SyntaxError:
filename
exception filename
lineno
exception lineno
msg
exception msg
offset
exception offset
print_file_and_line
exception print_file_and_line
text
exception text

Data and other attributes inherited from exceptions.SyntaxError:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class QName(__builtin__.object)
     Methods defined here:
__cmp__(self, other)
__hash__(self)
__init__(self, text_or_uri, tag=None)
__str__(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class TreeBuilder(__builtin__.object)
     Methods defined here:
__init__(self, element_factory=None)
close(self)
data(self, data)
end(self, tag)
start(self, tag, attrs)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class XMLParser(__builtin__.object)
     Methods defined here:
__init__(self, html=0, target=None, encoding=None)
close(self)
doctype(self, name, pubid, system)
This method of XMLParser is deprecated.
feed(self, data)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
XMLTreeBuilder = class XMLParser(__builtin__.object)
     Methods defined here:
__init__(self, html=0, target=None, encoding=None)
close(self)
doctype(self, name, pubid, system)
This method of XMLParser is deprecated.
feed(self, data)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
Comment(text=None)
PI = ProcessingInstruction(target, text=None)
ProcessingInstruction(target, text=None)
SubElement(parent, tag, attrib={}, **extra)
XML(text, parser=None)
dump(elem)
fromstring = XML(text, parser=None)
fromstringlist(sequence, parser=None)
iselement(element)
iterparse(source, events=None, parser=None)
parse(source, parser=None)
tostring(element, encoding=None, method=None)
tostringlist(element, encoding=None, method=None)

 
Data
        VERSION = '1.3.0'
__all__ = ['Comment', 'dump', 'Element', 'ElementTree', 'fromstring', 'fromstringlist', 'iselement', 'iterparse', 'parse', 'ParseError', 'PI', 'ProcessingInstruction', 'QName', 'SubElement', 'tostring', 'tostringlist', 'TreeBuilder', 'VERSION', 'XML', 'XMLParser', ...]