xsl-list
[Top] [All Lists]

RE: Grouping Using XSL

2003-01-21 03:19:43
You can use <xsl:for-each-group> in Saxon 7.x if you're prepared to use
a product (and spec) that's still work in progress.

The alternative is to stick with good old Muenchian grouping:
http://www.jenitennison.com/xslt/grouping.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 


-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Rigoberto
Sent: 21 January 2003 01:20
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Grouping Using XSL


hi everybody!!!

I got some problems grouping some data from a xml doc. 
Actually the xml 
doc looks like this:

<data>
      <col id="1">1</col>
      <col id="2">1</col>
      <col id="3">hello</col>
</data>
<data>
      <col id="1">1</col>
      <col id="2">1</col>
      <col id="3">bye</col>
</data>
<data>
      <col id="1">1</col>
      <col id="2">1</col>
      <col id="3">oops</col>
</data>
<data>
      <col id="1">1</col>
      <col id="2">2</col>
      <col id="3">hello</col>
</data>

what i´m trying to do, is create an xml document grouping the 
document 
source using the col elements dinamically ( col[1], col[1] 
and col[2], 
col[2],etc). so, if i use col[1] and col[2] the results should looks 
like this:

<data>
      <col id="1">1</col>
      <col id="2">1</col>
      <col id="3">
                  <val>hello</val>
                  <val>bye</val>
                  <val>oops</val>
      </col>
</data>
<data>
      <col id="1">1</col>
      <col id="2">2</col>
      <col id="3">
                  <val>hello</val>
      </col>
</data>

i´m using xalan(xalan-j_2_4_1) processor so I THINK (maybe i´m wrong) 
that i can´t use the <xsl:for-each-group/> tag. can i use any other 
processor? what can i do? any ideas?
i´m using jdk1.3.1.

thanks.

______________________________________________________________
_________
Te recomendamos:
Aventuras para los más pequeños en: 
http://www.terra.com.co/ninos/ Vive la pasión > del fútbol en: 
http://www.terra.com.co/deportes/futbol/



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



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



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