[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] testing for matches
hello list,
i have <items> <item> <date>011020<date> <stuff>stuff...</stuff> <name>jane</name> <stuff>stuff...</stuff> . . </item> <item> <date>011020<date> <stuff>stuff...</stuff> <name>alfa</name> <stuff>stuff...</stuff> . . </item> <item> <date>011020<date> <stuff>stuff...</stuff> <name>alfa</name> <stuff>stuff...</stuff> . . </item> <item> <date>011021<date> <stuff>stuff...</stuff> <name>jane</name> <stuff>stuff...</stuff> . . </item> <item> <date>011021<date> <stuff>stuff...</stuff> <name>bata</name> <stuff>stuff...</stuff> . . </item> <item> <date>011020<date> <stuff>stuff...</stuff> <name>betta</name> <stuff>stuff...</stuff> . . </item> <item> <date>011021<date> <stuff>stuff...</stuff> <name>jane</name> <stuff>stuff...</stuff> . . </item> </items> and i want an output like date name ----------------------- 011020 jane same as above alfa same as above same as above 011021 jane same as above betta 011020 same as above 011021 jane that is to have "same as above" where the previouse date/name is the same. i've been trying something like: <xsl:template match="item"> <xsl:choose> <xsl:when test="not(preceding::item[position()=last()]/date=date)"> <!--for date--> <!-- <xsl:when test="not(preceding::item[position()=last()]/name=name)"> and this one for name--> <xsl:value-of select="date"/><br/> </xsl:when> <xsl:otherwise>same as above</xsl:otherwise> </xsl:choose> </xsl:template> and this one for name: <xsl:template match="item"> <xsl:choose> <xsl:when test="not(preceding::item[position()=last()]/name=name)"> <xsl:value-of select="date"/><br/> </xsl:when> <xsl:otherwise>same as above</xsl:otherwise> </xsl:choose> </xsl:template> but i dont succeed. whats wrong? thank you jian _________________________________________________________________ Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com 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
|