RE: untitled from Biray Giray: colour on first occurre
Biray wrote: >I need to select the first occurance of values in attributes of elements and show them in different >color. Hello Biray, This is pretty much conjecture but: One approach would be to use recursion: every time you come across a new attribute value, call the template you're in with the updated list of values encountered as a parameter. The trouble here would be that it makes it difficult to apply other templates while you're stuck in a recursion loop. I wonder if you could use a key? How about <xsl:key name="firsts" match="//Content[not(./preceding::Content/@ContentText=./@ContentText)]" use="@ContentText"/> should give you a handle on all the Content nodes with ContentText attributes without precedent. Then when you were matching the Content nodes you would set the colour using <xsl:choose> <xsl:when test="(count(. | key('firsts',@ContentText)) = 1)"> - do whatever with red here </xsl:when> <xsl:otherwise> - do whatever in black here </xsl:otherwise> </xsl:choose> This works across ALL Content nodes. hth Tom Weissmann 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