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

# Class XPathElementEvaluator

             object --+
                      |
    _XPathEvaluatorBase --+
                          |
                         XPathElementEvaluator

Known Subclasses:
  - XPathDocumentEvaluator

XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True) Create an XPath evaluator for an element.

Absolute XPath expressions (starting with '/') will be evaluated against the ElementTree as returned by getroottree().

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). Smart strings will be returned for string results unless you pass `smart_strings=False`.

Instance Methods | [hide private]
__call__(self, _path, **_variables) Evaluate an XPath expression on the document. |
__init__(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True) x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
a new object with type S, a subtype of T |
__new__(T, S, ...) |
register_namespace(...) Register a namespace with the XPath context. |
register_namespaces(...) Register a prefix -> uri dict. |
Inherited from `_XPathEvaluatorBase`: `evaluate` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
Inherited from `_XPathEvaluatorBase`: `error_log` Inherited from `object`: `__class__`

Method Details | [hide private]

### __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. Absolute XPath expressions (starting with '/') will be evaluated against the ElementTree as returned by getroottree().

### __init__(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=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__