Home | Trees | Indices | Help |
|
---|
|
Version: 2.0.10-60473
Classes | |
AncestorsIterator AncestorsIterator(self, node, tag=None) Iterates over the ancestors of an element (from parent to parent). |
|
AttributeBasedElementClassLookup AttributeBasedElementClassLookup(self, attribute_name, class_mapping, fallback=None) Checks an attribute of an Element and looks up the value in a class dictionary. |
|
C14NError Error during C14N serialisation. |
|
CommentBase All custom Comment classes must inherit from this one. |
|
CustomElementClassLookup CustomElementClassLookup(self, fallback=None) Element class lookup based on a subclass method. |
|
DTD DTD(self, file=None, external_id=None) A DTD validator. |
|
DTDError Base class for DTD errors. |
|
DTDParseError Error while parsing a DTD. |
|
DTDValidateError Error while validating an XML document with a DTD. |
|
DocInfo Document information provided by parser and DTD. |
|
DocumentInvalid Validation error. |
|
ETCompatXMLParser ETCompatXMLParser(self, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, remove_blank_text=False, compact=True, resolve_entities=True, remove_comments=True, remove_pis=True, target=None, encoding=None, schema=None) An XML parser with an ElementTree compatible default setup. |
|
ETXPath ETXPath(self, path, extensions=None, regexp=True) Special XPath class that supports the ElementTree {uri} notation for namespaces. |
|
ElementBase All custom Element classes must inherit from this one. |
|
ElementChildIterator ElementChildIterator(self, node, tag=None, reversed=False) Iterates over the children of an element. |
|
ElementClassLookup ElementClassLookup(self) |
|
ElementDefaultClassLookup ElementDefaultClassLookup(self, element=None, comment=None, pi=None, entity=None) Element class lookup scheme that always returns the default Element class. |
|
ElementDepthFirstIterator ElementDepthFirstIterator(self, node, tag=None, inclusive=True) Iterates over an element and its sub-elements in document order (depth first pre-order). |
|
ElementNamespaceClassLookup ElementNamespaceClassLookup(self, fallback=None) |
|
ElementTextIterator ElementTextIterator(self, element, tag=None, with_tail=True) Iterates over the text content of a subtree. |
|
EntityBase All custom Entity classes must inherit from this one. |
|
Error | |
ErrorDomains Libxml2 error domains |
|
ErrorLevels Libxml2 error levels |
|
ErrorTypes Libxml2 error types |
|
FallbackElementClassLookup FallbackElementClassLookup(self, fallback=None) |
|
HTMLParser HTMLParser(self, recover=True, no_network=True, remove_blank_text=False, compact=True, remove_comments=False, remove_pis=False, target=None, encoding=None, schema=None) The HTML parser. |
|
LxmlError Main exception base class for lxml. |
|
LxmlRegistryError Base class of lxml registry errors. |
|
LxmlSyntaxError Base class for all syntax errors. |
|
NamespaceRegistryError Error registering a namespace extension. |
|
PIBase All custom Processing Instruction classes must inherit from this one. |
|
ParseError Syntax error while parsing an XML document. |
|
ParserBasedElementClassLookup ParserBasedElementClassLookup(self, fallback=None) Element class lookup based on the XML parser. |
|
ParserError Internal lxml parser error. |
|
PyErrorLog PyErrorLog(self, logger_name=None) A global error log that connects to the Python stdlib logging package. |
|
QName QName(text_or_uri, tag=None) |
|
RelaxNG RelaxNG(self, etree=None, file=None) Turn a document into a Relax NG validator. |
|
RelaxNGError Base class for RelaxNG errors. |
|
RelaxNGErrorTypes Libxml2 RelaxNG error types |
|
RelaxNGParseError Error while parsing an XML document as RelaxNG. |
|
RelaxNGValidateError Error while validating an XML document with a RelaxNG schema. |
|
Resolver This is the base class of all resolvers. |
|
Schematron Schematron(self, etree=None, file=None) A Schematron validator. |
|
SchematronError Base class of all Schematron errors. |
|
SchematronParseError Error while parsing an XML document as Schematron schema. |
|
SchematronValidateError Error while validating an XML document with a Schematron schema. |
|
SiblingsIterator SiblingsIterator(self, node, tag=None, preceding=False) Iterates over the siblings of an element. |
|
TreeBuilder TreeBuilder(self, element_factory=None, parser=None) Parser target that builds a tree. |
|
XInclude XInclude(self) XInclude processor. |
|
XIncludeError Error during XInclude processing. |
|
XMLParser XMLParser(self, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, remove_blank_text=False, compact=True, resolve_entities=True, remove_comments=False, remove_pis=False, target=None, encoding=None, schema=None) The XML parser. |
|
XMLSchema XMLSchema(self, etree=None, file=None) Turn a document into an XML Schema validator. |
|
XMLSchemaError Base class of all XML Schema errors |
|
XMLSchemaParseError Error while parsing an XML document as XML Schema. |
|
XMLSchemaValidateError Error while validating an XML document with an XML Schema. |
|
XMLSyntaxError Syntax error while parsing an XML document. |
|
XPath XPath(self, path, namespaces=None, extensions=None, regexp=True) A compiled XPath expression that can be called on Elements and ElementTrees. |
|
XPathDocumentEvaluator XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True) Create an XPath evaluator for an ElementTree. |
|
XPathElementEvaluator XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True) Create an XPath evaluator for an element. |
|
XPathError Base class of all XPath errors. |
|
XPathEvalError Error during XPath evaluation. |
|
XPathFunctionError Internal error looking up an XPath extension function. |
|
XPathResultError Error handling an XPath result. |
|
XPathSyntaxError | |
XSLT XSLT(self, xslt_input, extensions=None, regexp=True, access_control=None) |
|
XSLTAccessControl XSLTAccessControl(self, read_file=True, write_file=True, create_dir=True, read_network=True, write_network=True) |
|
XSLTApplyError Error running an XSL transformation. |
|
XSLTError Base class of all XSLT errors. |
|
XSLTExtensionError Error registering an XSLT extension. |
|
XSLTParseError Error parsing a stylesheet document. |
|
XSLTSaveError Error serialising an XSLT result. |
|
iterparse iterparse(self, source, events=("end",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, schema=None) Incremental parser. |
|
iterwalk iterwalk(self, element_or_tree, events=("end",), tag=None) |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
DEBUG = 1
|
|
LIBXML_COMPILED_VERSION =
|
|
LIBXML_VERSION =
|
|
LIBXSLT_COMPILED_VERSION =
|
|
LIBXSLT_VERSION =
|
|
LXML_VERSION =
|
|
__pyx_capi__ =
|
Function Details |
|
|
|
Build a dictionary of extension functions from the functions defined in a module or the methods of an object. As second argument, you can pass an additional mapping of attribute names to XPath function names, or a list of function names that should be taken. The ns keyword argument accepts a namespace URI for the XPath functions. |
Retrieve the function namespace object associated with the given URI. Creates a new one if it does not yet exist. A function namespace can only be used to register extension functions. |
Parses an HTML document from a string constant. This function can be used to embed "HTML literals" in Python code. To override the parser with a different HTMLParser you can pass it to the parser keyword argument. The base_url keyword argument allows to set the original base URL of the document to support relative Paths when looking up external entities (DTD, XInclude, ...). |
|
|
|
Parses an XML document from a string constant. This function can be used to embed "XML literals" in Python code, like in >>> root = etree.XML("<root><test/></root>") To override the parser with a different XMLParser you can pass it to the parser keyword argument. The base_url keyword argument allows to set the original base URL of the document to support relative Paths when looking up external entities (DTD, XInclude, ...). |
Parse the text and return a tuple (root node, ID dictionary). The root node is the same as returned by the XML() function. The dictionary contains string-element pairs. The dictionary keys are the values of ID attributes as defined by the DTD. The elements referenced by the ID are stored as dictionary values. Note that you must not modify the XML tree if you use the ID dictionary. The results are undefined. |
|
Creates an XPath evaluator for an ElementTree or an Element. The resulting object can be called with an XPath expression as argument and XPath variables provided as keyword arguments. Additional namespace declarations can be passed with the 'namespace' keyword argument. EXSLT regular expression support can be disabled with the 'regexp' boolean keyword (defaults to True). |
Deprecated: use clear_error_log() instead. |
|
|
Parses an XML document from a string. To override the default parser with a different parser you can pass it to the parser keyword argument. The base_url keyword argument allows to set the original base URL of the document to support relative Paths when looking up external entities (DTD, XInclude, ...). |
Parses an XML document from a sequence of strings. To override the default parser with a different parser you can pass it to the parser keyword argument. |
Deprecated: please use get_default_parser instead. |
Return an ElementTree object loaded with source elements. If no parser is provided as second argument, the default parser is used. The base_url keyword allows setting a URL for the document when parsing from a file-like object. This is needed when looking up external entities (DTD, XInclude, ...) with relative paths. |
Parses the source into a tuple containing an ElementTree object and an ID dictionary. If no parser is provided as second argument, the default parser is used. Note that you must not modify the XML tree if you use the ID dictionary. The results are undefined. |
Deprecated: please use set_default_parser instead. |
Deprecated: use set_element_class_lookup(lookup) instead |
Set a default parser for the current thread. This parser is used globally whenever no parser is supplied to the various parse functions of the lxml API. If this function is called without a parser (or if it is None), the default parser is reset to the original configuration. Note that the pre-installed default parser is not thread-safe. Avoid the default parser in multi-threaded environments. You can create a separate parser for each thread explicitly or use a parser pool. |
Serialize an element to an encoded string representation of its XML tree. Defaults to ASCII encoding without XML declaration. This behaviour can be configured with the keyword arguments 'encoding' (string) and 'xml_declaration' (bool). Note that changing the encoding to a non UTF-8 compatible encoding will enable a declaration by default. You can also serialise to a Unicode string without declaration by passing the unicode function as encoding. The keyword argument 'pretty_print' (bool) enables formatted XML. The keyword argument 'method' selects the output method: 'xml', 'html' or plain 'text'. You can prevent the tail text of the element from being serialised by passing the boolean with_tail option. This has no impact on the tail text of children, which will always be serialised. |
Serialize an element to an encoded string representation of its XML tree, stored in a list of partial strings. This is purely for ElementTree 1.3 compatibility. The result is a single string wrapped in a list. |
Serialize an element to the Python unicode representation of its XML tree. Note that the result does not carry an XML encoding declaration and is therefore not necessarily suited for serialization to byte streams without further treatment. The boolean keyword argument 'pretty_print' enables formatted XML. The keyword argument 'method' selects the output method: 'xml', 'html' or plain 'text'. You can prevent the tail text of the element from being serialised by passing the boolean with_tail option. This has no impact on the tail text of children, which will always be serialised. Deprecated: use tostring(el, encoding=unicode) instead. |
Replace the global error log by an etree.PyErrorLog that uses the standard Python logging package. Note that this disables access to the global error log from exceptions. Parsers, XSLT etc. will continue to provide their normal local error log. Deprecated: use use_global_python_log() instead. |
Replace the global error log by an etree.PyErrorLog that uses the standard Python logging package. Note that this disables access to the global error log from exceptions. Parsers, XSLT etc. will continue to provide their normal local error log. |
Variables Details |
__pyx_capi__
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Fri Dec 12 22:46:59 2008 | http://epydoc.sourceforge.net |