xsl-list
[Top] [All Lists]

Grouping of Tags

2003-06-20 04:53:25
Hello Everybody,

I have got a little problem with my Stylesheet.
In my XML I have two types of tags. My result should be a table where I want 
for every block of the first tag a new row which contains all the following 
second tags.

A possible xml doc:

<root>
        <first no="1"/>
        <second no="2"/>
        <second no="3"/>
        <first no="4"/>
        <first no="5"/>
        <second no="6"/>
        <second no="7"/>
        <first no="8"/>
        <second no="9"/>
</root>


I want the following:

<table>
        <tr>
                <td><first no="1"/></td>
                <td><second no="2"/><second no="3"/></td>
        </tr>
        <tr>
                <td><first no="4"/><first no="5"/></td>
                <td><second no="6"/><second no="7"/></td>
        </tr>
        <tr>
                <td><first no="8"/></td>
                <td><second no="9"/></td>
        </tr>
</table>

Is this possbile with xsl? I haved tried this for several hours but I could 
not find a solution.

Thanks in advance,

Marc


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



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