4
votes

In my xslt, I am calling external code to assign a node set to a xslt variable. I would now like to apply template on this node set.

<xsl:variable name="var1" select="ExtObject:GetNodeSet()"/>

So far I have seen that templates can be applied to input xml document. But can I parse the xml assigned to var1 with apply templates and reflect the result in the output document?

1

1 Answers

5
votes

Yes, just use

<xsl:variable name="$var1" select="ExtObject:GetNodeSet()"/>

and

<xsl:apply templates select="$var1"/>

This works because the variable retains all type information, so the correct template can be found.