xsl-list
[Top] [All Lists]

RE: Sorting a delimited attribute

2004-06-17 00:01:27
Split the values as you have done. Now do a second phase of transformation.
The second phase is a standard grouping exercise - use Muenchian grouping on
the <tr> elements with substring(tr/td[1],1,1) as the grouping key.

Michael Kay  

-----Original Message-----
From: perry(_dot_)ielati(_at_)iinet(_dot_)net(_dot_)au 
[mailto:perry(_dot_)ielati(_at_)iinet(_dot_)net(_dot_)au] 
Sent: 17 June 2004 05:12
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Sorting a delimited attribute

Hi all

Newbie to the forum (and to XSL/T ) and i have a problem that 
i'm hoping 
someone can help me with.

I have an XML attribute that is seperated by commas(,) and 
pipes(|). Here's a 
small sample...

CC_DESCRIPTION="D686,Work,1|E004,English,2|E005,English,2|E012
,Media,1|E231,Busi
ness Technology,1|E280,Applied Technology,1|E282,Technical 
Graphics,1| etc etc "

What I need to do is create 2 HTML tables with each pipe(|) 
seperated set of 
values in a new row and each comma(,) seperated value in it's 
own cell.

Ie..

<table>
  <tr>
    <td>D686 (code)</td>
    <td>Work (title)</td>
    <td>1 (points)</td>
  </tr>
  <tr>
    <td>E004 (code)</td>
    <td>English (title)</td>
    <td>2 (points)</td>
  </tr>
</table> etc etc

I've done this, however, all the values are in 1 table - what 
I need to do is 
now split the data - all codes starting with 'E' should be in 
a seperate table 
to those starting with 'E'.

I'm completely baffled. Any help would be appreciated.

BTW, I have no control over the layout of the XML...only the XSL.

Thanks in advance,
Perry

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