Phillip B Oldham | 12 May 2012 20:21
Picon
Gravatar

Custom XPath functions and "self" (or ".")

If I create a custom XPath function and use it in my XSL sheet using
`self`, `self::node()`, `.` or `current()` as the nodeset passed in,
for example:

<xsl:if test="custom:my-func(.)">...

... the list of nodes is empty within the XPath function. If I use the
name of the node referenced by `self` then everything works as
expected and a list of nodes is passed into the function.

I've created a testcase to explain better than I can in an email:
http://pastebin.com/5jkBhRSD

Is this the expected behaviour?

--

-- 
Phillip B Oldham
phillip.oldham <at> gmail.com
+44 (0) 7525 01 09 01
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml

Gmane