[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] grouping problem


Subject: RE: [xsl] grouping problem
From: "SINGH Navpreet" <Navpreet.SINGH@xxxxxxxxx>
Date: Wed, 18 Oct 2006 09:01:51 +1000

Thanks a lot David.

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Wednesday, 18 October 2006 8:51 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] grouping problem



Could probably be made more efficient but...

<xsl:template match="data">
  <xsl:variable name="range" select="tokenize(range,',')"/>
  <xsl:for-each-group select="record" group-by="node/type">
    <xsl:value-of select="'&#10;',current-grouping-key(),':',$range[
                          some $e in current-group() satisfies
                          position() &gt;=
                          index-of($range,$e/start)
                          and
                          position() &lt;=
                          index-of($range,$e/end)
                          ]"/>

  </xsl:for-each-group>
</xsl:template>
</xsl:stylesheet>



$ saxon8 range.xml  range.xsl
<?xml version="1.0" encoding="UTF-8"?>
 type1 : 0 2 4 5 6 7
 type2 : 0 7 8 9 A B C D E F


David


Disclaimer :
The contents of this e-mail including any attachments are intended only
for the person or entity to which this e-mail is addressed.  If you are not,
or believe you may not be, the intended recipient, please advise the sender
immediately by return e-mail, delete this e-mail and destroy any copies.
Tenix does not warrant nor guarantee that this email communication is free
from errors, virus, interception or interference.


Current Thread