Reputation: 2025
When applying a template to nodes that are loaded by doc(), how can I access the orignial input document in that template? Is there another way than adding a parameter like this?
<xsl:apply-templates select="doc('snippets.xml')//snippet">
<xsl:with-param name="input-document" select="/" />
</xsl:apply-templates>
Upvotes: 0
Views: 55
Reputation: 167706
You can have a global variable e.g.
<xsl:variable name="primary-input" select="/"/>
and then use $primary-input
where needed. The name of the variable is up to you.
Upvotes: 1