This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
getting the context out of a variable
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] getting the context out of a variable
- From: Jörg Heinicke <Joerg dot Heinicke at gmx dot de>
- Date: Tue, 18 Sep 2001 14:11:46 +0200 (MEST)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hello,
another problem, which I have, is getting the context out of a variable.
An example:
<xsl:variable name="tree" select="document(tree.xml)/root"/>
<xsl:template match="/">
<xsl:apply-templates select="$tree/node"/>
</xsl:template>
<xsl:template match="node">
<!-- the context is here now in the variable -->
<xsl:if test="@name = /page/html/node/@name">
<!-- this won't work for a XML-input-file with this structure
because the context is the variable and there is the structure /root/node. -->
</xsl:if>
</xsl:template>
The only solution I found until now was to store the original XML-file in a
variable too and use it like following:
<xsl:if test="@name = $original/page/html/node/@name">
But is there a better solution?
Thanks in advance,
Joerg
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list