Subject: Re: [xsl] Grouping consecutive page numbers for index (xslt 1.0) From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 21 Aug 2013 15:29:33 +0100 |
Hello,
Would really appreciate some guidance with the following problem. I'm stuck with XSLT 1.0. Any pointers as to the best approach would help.
INPUT: <pages> <page>1</page> <page>2</page> <page>3</page> <page>6</page> <page>12</page> <page>13</page> <page>14</page> <page>15</page> <page>16</page> </pages>
DESIRED OUTPUT: <pages> <page>1-3</page> <page>6</page> <page>12-16</page> </pages>
Regards.
--
<page>1-3</page> <page>6</page> <page>12-16</page>
<xsl:template match="pages"> <xsl:apply-templates select="page[1]"> <xsl:with-param name="first" select="page[1]"/> <xsl:with-param name="last" select="page[1]"/> </xsl:apply-templates> </xsl:template>
________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Grouping consecutive page num, Kevin Bird | Thread | Re: [xsl] Grouping consecutive page, Wendell Piez |
[xsl] Grouping consecutive page num, Kevin Bird | Date | [xsl] My first attempt at XSLT stre, Costello, Roger L. |
Month |