xsl-list
[Top] [All Lists]

Re: [xsl] grouping problem

2006-10-17 15:51:18

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>
--~--

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