xsl-list
[Top] [All Lists]

RE: [xsl] FW: grouping problem

2006-10-17 16:01:42
Thanks Michael.

-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Sent: Wednesday, 18 October 2006 8:37 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] FW: grouping problem


Write a function that decides which group a given value is in

<xsl:function name="my:group">
  <xsl:param name="x"/>
  <xsl:sequence select="$data/record[start le $x and end ge
$x]/node/type"/>
</

then invoke this function in the group-by expression of
xsl:for-each-group:

<xsl:for-each-group select="tokenize(range,',')" group-by="my:group(.)">

Michael Kay
http://www.saxonica.com/

 

-----Original Message-----
From: SINGH Navpreet [mailto:Navpreet(_dot_)SINGH(_at_)Tenix(_dot_)com] 
Sent: 17 October 2006 22:44
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] FW: grouping problem

Still waiting for reply on the following post. Can anyone 
help me with this.
thanks.

 -----Original Message-----
From:       SINGH Navpreet  
Sent:       Tuesday, 17 October 2006 4:56 PM
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject:    grouping problem

Hi all,
Need help with the following problem which I suppose should use 
xsl:group in XSLT2.0. What I want to do is to group the result by 
<type> element (type1 and type2). Element <range> has all the valid 
values and this should be used to find out all values that fall 
between <start> and <end> element for each <record>. So expected 
result is
type1: 0,2,4,5,6,7
type2: 0,7,8,9,A,B,C,D,E,F

<data>
    <range>0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F</range>
    <record>
            <start>0</start>
            <end>0</end>
            <node>
                    <type>type1</type>
            </node>
    </record>
    <record>
            <start>0</start>
            <end>0</end>
            <node>
                    <type>type2</type>
            </node>
    </record>
    <record>
            <start>2</start>
            <end>2</end>
            <node>
                    <type>type1</type>
            </node>
    </record>
    <record>
            <start>4</start>
            <end>7</end>
            <node>
                    <type>type1</type>
            </node>
    </record>
    <record>
            <start>7</start>
            <end>F</end>
            <node>
                    <type>type2</type>
            </node>
    </record>
</data>

Thanks.


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



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