[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Unique entries from substrings
Andreas,
You could approach it as a grouping problem, in which case this input:
with this xsl: <?xml version="1.0" encoding="iso8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:key match="DATE" name="kDates" use="concat(substring(., 1, 2), substring(., 7))"/> <xsl:template match="DATE[generate-id(.) = generate-id( key('kDates', concat(substring(., 1, 2), substring(., 7)))[1]) ]"> <xsl:value-of select="concat(substring(., 1, 2), substring(., 7))"/> <xsl:text>
</xsl:text> </xsl:template> <xsl:template match="DATE"/> </xsl:stylesheet> Yields: <?xml version="1.0" encoding="UTF-8"?> 072005 052005 Of course, you may have to adjust to include the day, etc ... in which case you wouldn't need the substring and concat business. --A _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
|
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
|