xsl-list
[Top] [All Lists]

RE: [xsl] Transforming a non-hierarchical XML into a hierarchical one

2007-03-08 03:43:48

I'm guessing from your choice of element names that your hierarchic
structure is positional rather than defined by pointers.

This makes it a positional grouping problem. Such problems are always much
easier in XSLT 2.0, so you need to make it clear whether you want a 1.0 or a
2.0 solution.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: SEXpeare [mailto:sexpeare(_at_)gmail(_dot_)com] 
Sent: 08 March 2007 10:20
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Transforming a non-hierarchical XML into a 
hierarchical one

Hello everybody, I have to transform a non hierarchical XML:

      <sumario>
              <seccion txt=""/>
              <subseccion txt=""/>
              <organismo txt=""/>
              <anuncio txt=""/>
              <organismo txt=""/>
              <anuncio txt=""/>
              <organismo txt=""/>
              <anuncio txt=""/>
              <subseccion txt=""/>
              <organismo txt=""/>
              <anuncio txt=""/>
              <seccion txt=""/>
              <subseccion txt=""/>
              <organismo txt=""/>
              <anuncio txt=""/>
              ...
      </sumario>

into a hierarchical XML, doing this via XSLT. The result must 
be like this:

      <sumario>
              <seccion id="">
                      <subseccion id="">
                              <organismo id="">
                                      <anuncio>
                                      </anuncio>
                                      ...                     
                      
                              </organismo>
                      </subseccion>
              </seccion>
              ...
      </sumario>

I would apreciate any idea or advice, thx.

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



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