Re: Recursing on top-level elements

Subject: Re: Recursing on top-level elements
From: "Jan Thunqvist" <jan.thunqvist@xxxxxxxxxxx>
Date: Thu, 30 Mar 2000 14:46:00 +0200
         <xsl:when test="/test/foo/@id=@id">

Thanks David, but this doesn't work for me - I still can't get the baz with
b_id="3" in red, since the match for /test/foo/@f_id is the foo with
f_id="1".

Example XML (well-formed):

<test>
   <foo f_id="1"/>
   <foo f_id="3"/>
   <bar>
      <baz b_id="1"/>
      <baz b_id="2"/>
      <baz b_id="3"/>
      <baz b_id="4"/>
   </bar>
</test>

My XSL:

<xsl:template match="/">
   <xsl:for-each select="test/bar/baz">
      <xsl:choose>
         <xsl:when test=".[@b_id = /test/foo/@f_id]">
            <!-- Do something, e.g. paint it red -->
         </xsl:when>
         <xsl:otherwise>
            <!-- Do something else -->
         </xsl:otherwise>
      </xsl:choose>
   </xsl:for-each>
</xsl:template>


Thanks,

/Jan



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread