I need to get into a variable the internal structure of a node, the issue is that the node has different paths by different reasons. What I am doing until now is
<xsl:variable name="my_variable">
<xsl:choose>
<xsl:when test="One/Path/To/TheNode">
<xsl:value-of select="One/Path/To/TheNode"/>
</xsl:when>
<xsl:when test="One/Different/Path/To/TheNode">
<xsl:value-of select="One/Different/Path/To/TheNode"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//TheNode"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
And then if I use this variable to get some subnode doing:
<xsl:variable name="other_variable" select="$my_variable/Subnode"/>
I get this error in runtime XPath error : Invalid type Evaluating global variable var/param being computed failed, I tried too doing this:
<xsl:variable name="other_variable" select="ext:node-set($my_variable)/SubNode"/>
I don´t get any error executing the xslt, but other_variable is empty. Checking the content of my_variable doing <xsl:value-of select="$my_variable"/> or <xsl:apply-templates mode="copy" select="ext:node-set($my_variable)"/> I can see the data but without the xml structure, I mean I can see bar but not <foo>bar</bar>.
Is there any way to get this structure from a different path without use <xsl:variable name="my_variable" select="//TheNode"/>??
Thanks.
xsl:copy-ofinstead ofxsl:value-of?copybut I didn´t thinkcopy-of. Please, add as an answer and I´ll accept it. Thanks!!