xsl-list
[Top] [All Lists]

[xsl] Grouping the elements

2006-09-14 05:02:49
Hi,

I have the following xml for my input..

<?xml version="1.0" encoding="UTF-8"?>
<Root>
    <year>2006</year>
    <year>2007</year>
    <year>2008</year>
    <week>1</week>
    <day>01</day>
    <day>02</day>
</Root>


My expected output is 

<Root>
    <yearList>
        <year>2006</year>
         <year>2007</year>
        <year>2008</year>
     <yearList>
    <week>1</week>
    <dayList>
         <day>01</day>
         <day>02</day>
     </dayList>
</Root>


I want to group the element using xslt 1.0 and here element name is not 
fixed..it will be varied. when we have the same element then we need a parent 
element which have the element's name with List (i.e., yearList)

Is it possible to grouping in xslt1.0?

regards,
raj


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