Subject: Re: [xsl] overriding xpath functions|
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 09 Mar 2012 09:16:28 +0000
The description of the semantics starts in the XPath "language book", here:Hello, maybe dumb question - what happens when a processor encounters an expression using the eq operator (and the other related operators)? Since eq is sort of overloaded and calls different functions according to the type of the operands (op:numeric-equal, fn:compare etc). And especially when the operands are empty sequences - like in () eq ()? The result is an empty sequence*, but what steps lead to it?
No, it's not. The namespace URI associated with the "op" prefix is unspecified, so there's no way of writing a function in this namespace, and the "fn" namespace is reserved in both XQuery and XSLT, so there is a specific ban on writing functions in this namespace.Follow-up question - is it possible to override the built-in xpath functions in XSLT or XQuery?
Section 3.5.2 of the XPath language book, rule 2.
* is it written somewhere in the specs, that eq returns empty sequence when some of the operands is an empty sequence? I looked, but did not find it..
Michael Kay Saxonica