[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Recursing on top-level elements
<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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|