This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Reformatting


I have an XML structure that has a tag for each of the possible 24 channels
available in a T1 line. If a given channel is not available, no node is
generated.

    <T1>
      <ch>1</ch>
      <ch>2</ch>
      <ch>3</ch>
      <ch>4</ch>

      <ch>10</ch>
      <ch>11</ch>
      <ch>12</ch>
      <ch>13</ch>

      <ch>24</ch>
    </T1>

That said, I transform the XML into HTML by simply using:

    <xsl:template match="ch">
      <xsl:apply-templates/>,
    </xsl:template>

to produce:

     1,2,3,4,10,11,12,13,24 

I am trying to use XSLT format the output abbreviating ranges of channels.
The above would ideally be formatted as:

      1-4,10-13,24

Can this be done with XSLT? Perhaps any of the string() functions?

Thanks,

Greg



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]