Hi all.
I am processing two documents with an XSLT, one is the input document,
the other is loaded with the document() function in a variable $doc2.
Inside a template that matches an element from $doc2, I need to check a
value from the original input document. However, inside this template,
the context is $doc2. What XPath expression should I use to refer to the
input document? I've tried using /inputNamespace: inputElement, where
inputNamespace and inputElement refer to the input document. This
doesn't work because no such element exists within the context of the
template, which is $doc2.
A small example may clarify want I mean :-).
<xsl:stylesheet >
<xsl:template match="/">
<xsl:variable name="doc2" select="documen t('doc2.xml')"/>
<xsl:apply-templates select="$doc2/someNodeInDoc2"/>
</xsl:template>
<xsl:template match="someNode InDoc2">
<xsl:variable name="someNodeI nInputDoc" select="XPath expression
referring input document"/>
...
</xsl:template>
</xsl:stylesheet>
I solved the problem by defining an additional variable $inputDoc for
the input document and then using $inputDoc/someNodeInInput Doc, but
isn't there a way to directly access the input document, without
explicitly having to load the input document?
Thanks!
Filip Hendrickx.