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

Class XPathDocumentEvaluator

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

XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True, smart_strings=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). 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, etree, 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, ...)

Inherited from XPathElementEvaluator: register_namespace, register_namespaces

Inherited from _XPathEvaluatorBase: evaluate

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

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.

Overrides: XPathElementEvaluator.__call__

__init__(self, etree, 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__