This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

getting the context out of a variable


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]