[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Upon matching attribute value, increment output
Hi Russ,
You can count the number of preceding CON nodes with the same CODE attribute and if it is greater than zero output its value: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="CON"> <xsl:value-of select="@CODE"/> <xsl:variable name="precedingCodes" select="count(preceding-sibling::CON[@CODE=current()/@CODE])"/> <xsl:if test="$precedingCodes > 0"> <xsl:text>_</xsl:text> <xsl:value-of select="$precedingCodes"/> </xsl:if> </xsl:template> </xsl:stylesheet> Best Regards, George ----------------------------------------------- George Cristian Bina <oXygen/> XML Editor & XSLT Editor/Debugger http://www.oxygenxml.com Russ Little wrote:
|
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
|