[Home] [By Thread] [By Date] [Recent Entries]
On 21/03/2014 15:15, David Sewell wrote:
I wonder how much of the problem (and there is one, at least for beginning users of XPath/XQuery/XSLT, and it even bites old hands sometimes) is owing to the fact that the XPath syntax for an axis step followed by a node type is identical to the syntax for an axis step followed by a single-argument function.
<xsl:function name="my:text"> <xsl:param name="n"/> <xsl:sequence select="$n/text()"/> </xsl:function> then $node/text() and $node/my:text(.) are the same thing. the only magic part is that user-defined functions can not default the context node, so the syntax has to be $node/my:text(.) rather than $node/my:text() Basically all axis steps can be seen as syntactic sugar for functions that default to the context node and return a sequence of nodes. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|

Cart



