Package lxml :: Module etree :: Class _ElementTree
[show private | hide private]
[frames | no frames]

Type _ElementTree

object --+
         |
        _ElementTree

Known Subclasses:
_XSLTResultTree

Method Summary
  __copy__(...)
  __deepcopy__(...)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  _setroot(...)
Relocate the ElementTree to a new root node.
  find(...)
Finds the first toplevel element with given tag.
  findall(...)
Finds all toplevel elements with the given tag.
  findtext(...)
Finds the element text for the first toplevel element with given tag.
  getiterator(...)
Creates an iterator for the root element.
  getpath(...)
Returns a structural, absolute XPath expression to find that element.
  getroot(...)
Gets the root element for this tree.
  iter(...)
Creates an iterator for the root element.
  parse(...)
Updates self with the content of source and returns its root
  relaxng(...)
Validate this document using other document.
  write(...)
Write the tree to a file or file-like object.
  write_c14n(...)
C14N write of document.
  xinclude(...)
Process the XInclude nodes in this document and include the referenced XML fragments.
  xmlschema(...)
Validate this document using other document.
  xpath(...)
XPath evaluate in context of document.
  xslt(...)
Transform this document using other document.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
PyCObject __pyx_vtable__ = <PyCObject object at 0x401cb6c8>
getset_descriptor docinfo = <attribute 'docinfo' of 'lxml.etree._ElementTr...
getset_descriptor parser = <attribute 'parser' of 'lxml.etree._ElementTree...

Method Details

__new__(T, S, ...)

T.__new__(S, ...) -> a new object with type S, a subtype of T
Returns:
a new object with type S, a subtype of T
Overrides:
__builtin__.object.__new__

_setroot(...)

Relocate the ElementTree to a new root node.

find(...)

Finds the first toplevel element with given tag. Same as getroot().find(path).

findall(...)

Finds all toplevel elements with the given tag. Same as getroot().findall(path).

findtext(...)

Finds the element text for the first toplevel element with given tag. Same as getroot().findtext(path)

getiterator(...)

Creates an iterator for the root element. The iterator loops over all elements in this tree, in document order.

Note that this method is deprecated in favour of the ``el.iter()`` method. In new code, use it only if you require backwards compatibility.

getpath(...)

Returns a structural, absolute XPath expression to find that element.

getroot(...)

Gets the root element for this tree.

iter(...)

Creates an iterator for the root element. The iterator loops over all elements in this tree, in document order.

parse(...)

Updates self with the content of source and returns its root

relaxng(...)

Validate this document using other document.

The relaxng argument is a tree that should contain a Relax NG schema.

Returns True or False, depending on whether validation succeeded.

Note: if you are going to apply the same Relax NG schema against multiple documents, it is more efficient to use the RelaxNG class directly.

write(...)

Write the tree to a file or file-like object.

Defaults to ASCII encoding and writing a declaration as needed.

write_c14n(...)

C14N write of document. Always writes UTF-8.

xinclude(...)

Process the XInclude nodes in this document and include the referenced XML fragments.

There is support for loading files through the file system, HTTP and FTP.

Note that XInclude does not support custom resolvers in Python space due to restrictions of libxml2 <= 2.6.29.

xmlschema(...)

Validate this document using other document.

The xmlschema argument is a tree that should contain an XML Schema.

Returns True or False, depending on whether validation succeeded.

Note: If you are going to apply the same XML Schema against multiple documents, it is more efficient to use the XMLSchema class directly.

xpath(...)

XPath evaluate in context of document.

``namespaces`` is an optional dictionary with prefix to namespace URI mappings, used by XPath. ``extensions`` defines additional extension functions.

Returns a list (nodeset), or bool, float or string.

In case of a list result, return Element for element nodes, string for text and attribute values.

Note: if you are going to apply multiple XPath expressions against the same document, it is more efficient to use XPathEvaluator directly.

xslt(...)

Transform this document using other document.

xslt is a tree that should be XSLT keyword parameters are XSLT transformation parameters.

Returns the transformed tree.

Note: if you are going to apply the same XSLT stylesheet against multiple documents, it is more efficient to use the XSLT class directly.

Class Variable Details

__pyx_vtable__

Type:
PyCObject
Value:
<PyCObject object at 0x401cb6c8>                                       

docinfo

Type:
getset_descriptor
Value:
<attribute 'docinfo' of 'lxml.etree._ElementTree' objects>             

parser

Type:
getset_descriptor
Value:
<attribute 'parser' of 'lxml.etree._ElementTree' objects>              

Generated by Epydoc 2.1 on Sat Aug 18 12:44:27 2007 http://epydoc.sf.net