I have to upadte some scripts to Saxon 9.1.0.7 and I have some trouble with saxon:evaluate. Basicly I have to merge 3 or more XML into one. I did a small sample what happend.
this is my xslt:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/" version="2.0">
<xsl:template match="/">
<root>
<title>Test Doc</title>
<xsl:call-template name="slave">
<xsl:with-param name="path_to_node" select="root/firstnode"/>
<xsl:with-param name="document_src" select="document(root/docsrc)" />
</xsl:call-template>
</root>
</xsl:template>
<xsl:template name="slave">
<xsl:param name="path_to_node"/>
<xsl:param name="document_src"/>
<xsl:copy-of select="$document_src" />
<xsl:copy-of select="$path_to_node" />
<xsl:for-each select="saxon:evaluate(concat('$document_src', $path_to_node))">
<xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
this is my input xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
<docsrc>file://C:/Source/temp-docsrc.xml</docsrc>
<firstnode>/docsrc/nodesrc/*</firstnode>
</root>
and this is the additional Source temp-docsrc.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<docsrc>
<nodesrc>
<node_a>A</node_a>
<node_b>B</node_b>
<node_c>C</node_c>
<node_d>D</node_d>
</nodesrc>
</docsrc>
The processor tells me that:
Static error in XPath expression supplied to saxon:evaluate:
Undeclared variable in XPath expression: $document_src;
SystemID: ; Line#: 19; Column#: -1