[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Page number ranges
I'm working with an index in XSL FO. The source document looks like this: <index> <word page="12">cat</word> <word page="58">dog</word> <word page="23">giraffe</word> ... </index> The words are already sorted, and there are no duplicates (entries with both the same attribute and element value). The code for printing page numbers looks like this: <xsl:for-each select="//word[.=current()]"> <xsl:sort select="@page" data-type="number"/> <xsl:value-of select="@page"/> <xsl:if test="not(position()=last())"> <xsl:text>, </xsl:text> </xsl:if> </xsl:for-each> This works fine, but I want to add a feature so that pages 12, 13, 14 is written 12-14. How is that achieved? Gustaf 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
|