Google turned up nil so here I am.
I'm working on an XSLT in Java. This is not the only XSLT in the project, and the others work great. My issue is as follows:
I'm getting a javax.xml.transform.TransformerException with the error message "Could not find function: exists". My XSLT is as follows:
<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xpath="http://www.w3.org/2005/xpath-functions" xmlns:java="java"
xmlns:url="http://whatever/java/java.net.URLEncoder"
exclude-result-prefixes="url">
<xsl:template match="User">
<user>
<id><xsl:value-of select="id"/></id>
<xsl:if test="exists(first)"><first><xsl:value-of select="first"/></first></xsl:if>
</user>
</xsl:template>
</xsl:stylesheet>
The XML input is well formed, and if I remove the <xsl:if test="exists(first)"> line, everything works well.
As mentioned, I have other XSLTs that work well, including some that use the exists function. I checked the namespaces on the two, and they are identical.
Any idea what might be going on?
test="first". Asexistsis XPath 2, could it be that this transformation is programmed differently, say with Xalan (XPath 1)? If another SPI like Xerces was left out.