xsl-list
[Top] [All Lists]

RE: [xsl] grouping problem

2006-10-17 16:02:08
Thanks a lot David.

-----Original Message-----
From: David Carlisle [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk]
Sent: Wednesday, 18 October 2006 8:51 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


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.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>