[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
thunqvist
         <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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.