Next / Previous / Contents / Shipman's homepage

9.21. Element.xpath(): Evaluate an XPath expression

To evaluate an XPath expression s using some Element instance E as the context node:

E.xpath(s[, namespaces=N][, var=value][, ...])

For a general discussion of the use of XPath, see Section 10, “XPath processing”.


An XPath expression to be evaluated.


A namespace map that relates namespace prefixes to NSURIs; see Section 4.3, “Namespace maps”. The namespace map is used to interpret namespace prefixes in the XPath expression.


You may use additional keyword arguments to define the values of XPath variables to be used in the evaluation of s. For example, if you pass an argument count=17, the value of variable $count in the XPath expression will be 17.

The returned value may be any of: