I think there are two issues here.

Firstly, 3.0 functionality does need to be explicitly enabled. You can do that on the XPathCompiler: xpath.setLanguageVersion("3.0").

Secondly, the new math functions are in a special namespace (the only explanation I can offer for this is that it was designed by a committee). You need to use this namespace when calling the functions. In fact, the one up-side of the fact that they are in a special namespace is that a conformant 2.0 processor can offer these as extension functions, and I think therefore you can call them from Saxon without enabling 3.0, provided you get the namespace right.

Michael Kay

On 06/03/2013 11:48, Andrea Carlini wrote:
I'm trying to test XPath 3.0 math functions but I'm getting the Unknown system function error:

String strXpath = "pow(2,2)";
Processor proc =

new Processor(false);
XPathCompiler xpath = proc.newXPathCompiler();
DocumentBuilder docBuild = proc.newDocumentBuilder();
XdmNode source = docBuild.build (
new StreamSource( new StringReader (strXML)));
XPathSelector selector = xpath.compile(strXpath).load();
XdmValue result = selector.evaluate();
Returning :
net.sf.saxon.s9api.SaxonApiException: Unknown system function pow()
I'm using my licensed version of SaxonPE 9.4.
It seems that by default the compiler is using XPath 2.0, is there any settings to alter in order to use the 3.0 extensions ?
Thanks in advance and best regards.

Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 

saxon-help mailing list archived at http://saxon.markmail.org/