[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Adding structure to a flat xml


Subject: RE: [xsl] Adding structure to a flat xml
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 14 Aug 2003 16:24:17 +0100

Try a google for "XSLT positional grouping".

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Martti Poutanen
> Sent: 14 August 2003 15:24
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Adding structure to a flat xml
> 
> 
> Hello,
> 
> I cannot solve following problem:
> 
> source:
> <root>
>  <row>
>   <entry name="a">xxx</entry>
>   <entry name="b"></entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">module</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">module</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> .....
> </root>
> 
> and get output:
> 
> <root>
>  <row>
>   <entry name="a">xxx</entry>
>   <entry name="b"></entry>
>  <row>
> <module>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">module</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> </module>
> <module>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">module</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> <row>
>   <entry name="a">xxx</entry>
>   <entry name="b">yyy</entry>
>  <row>
> .....
> </module>
> </root>
> 
> ie. i need to "wrap" all rows to element module starting 
> module node when a row with entry/[@name='b']/text()='module'.
> 
> Thanks in advance,
> 
> martti
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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



Current Thread
Keywords
xml