Package lxml :: Module etree :: Class XPathDocumentEvaluator

[frames] | no frames]

# Class XPathDocumentEvaluator

             object --+
                      |
    _XPathEvaluatorBase --+
                          |
      XPathElementEvaluator --+
                              |
                             XPathDocumentEvaluator

XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True) Create an XPath evaluator for an ElementTree.

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).

Instance Methods

__call__(self, _path, **_variables) Evaluate an XPath expression on the document. |

__init__(self, etree, namespaces=None, extensions=None, regexp=True) x.__init__(...) initializes x; see x.__class__.__doc__ for signature |

a new object with type S, a subtype of T

__new__(T, S, ...) |

Inherited from `XPathElementEvaluator`: `registerNamespace`, `registerNamespaces`, `register_namespace`, `register_namespaces` Inherited from `_XPathEvaluatorBase`: `evaluate` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Properties
Inherited from `_XPathEvaluatorBase`: `error_log` Inherited from `object`: `__class__`

Method Details

### __call__(self, _path, **_variables)
(Call operator)

Evaluate an XPath expression on the document.

Variables may be provided as keyword arguments. Note that namespaces are currently not supported for variables.

Overrides: XPathElementEvaluator.__call__

### __init__(self, etree, namespaces=None, extensions=None, regexp=True)
(Constructor)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

### __new__(T, S, ...)

Returns: a new object with type S, a subtype of T
Overrides: object.__new__