xsl-list
[Top] [All Lists]

XSL Parent loop access?

2004-04-16 09:33:01
Hello!

I really need to access the parent loop in an inner xsl:for-each loop

this is my xml:

<root>
        <item>
                <text>Some text</testtext>
                <subitem>
                        <text>Some text</text>
                </subitem>
                <subitem>
                        <text>Some text2</text>
                </subitem>
        </item>
        <item>
                <testtext>Some text2</testtext>
                <subitem>
                        <text>Some text2</text>
                </subitem>
                <subitem>
                        <text>Some text3</text>
                </subitem>
        </item>
</root>

and my xsl:

<xsl:for-each select="item">
        Itemtext: <xsl:value-of select="text" />
        <xsl:for-each select="subitem">
                <xsl:if test="text=item/text">
                        Match found:  <xsl:value-of select="text" />
                </xsl:if>
        </xsl:for-each>
</xsl:for-each>

So how do i make this if clause compare the text of the current subitem with the text of the current item?
<xsl:if test="text=item/text"> does not work

Thanks alot in advance!!



<Prev in Thread] Current Thread [Next in Thread>