[xsl] group by tags

Subject: [xsl] group by tags
From: IZASKUN GUTIERREZ GUTIERREZ <igutierrez027@xxxxxxxxxxxxx>
Date: Wed, 2 Jul 2008 11:22:03 +0200
Hello everybody!

I need group by tags this xml for example. The problem is that I dont
know the name of the tags. Only I know the tag "Book" and the ID
"boo2". I dont know too
the extension of de levels of the subtrees, but the groupment must be
make by the tags that are writed in lowercase, and only group by tags
writed in upperecase if the tags are the same. (I dont control all of
the data). I need one generic template .


<?xml version="1.0"?> <rdf:RDF xmlns:foaf="http://xmlns.com/foaf/0.1/"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>

<Book rdf:ID="boo2">
   <address rdf:dataytpe="aaa">Almogavers 56</address>

   <event>
      <Inbook>
         <month rdf:dataytpe="bbb">July</month>
      </Inbook>
   </event>
   <event>
      <Inbook>
         <year rdf:dataytpe="ccc">2006</year>
      </Inbook>
   </event>

   <proceedings>
      <Proceedings>
        <year rdf:dataytpe="ddd">2008</year>
      </Proceedings>
   </proceedings>
   <proceedings>
      <Misc>
        <month rdf:dataytpe="ddd">May</month>
      </Misc>
   </proceedings>

   <art>
      <Manual>
           <man>
               <Article>
                   <month rdf:dataytpe="nnn">September</month>
               </Article>
           </man>
           <city rdf:dataytpe="ppp">September</city>
      </Manual>
   </art>
   <art>
      <Manual>
           <man>
                <Article>
                  <year rdf:dataytpe="eee">2004</year>
                </Article>
           </man>
      </Manual>
   </art>


</Book>


</rdf:RDF>



I want this result:

<?xml version="1.0"?>
<rdf:RDF   xmlns:foaf="http://xmlns.com/foaf/0.1/";
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
<Book rdf:ID="boo2">
   <address rdf:dataytpe="aaa">Almogavers 56</address>

   <event>
      <Inbook>
         <month rdf:dataytpe="bbb">July</month>
         <year rdf:dataytpe="ccc">2006</year>
      </Inbook>
   </event>


<proceedings> <Proceedings> <year rdf:dataytpe="ddd">2008</year> </Proceedings> <Misc> <month rdf:dataytpe="ddd">May</month> </Misc> </proceedings>

   <art>
      <Manual>
           <man>
               <Article>
                   <month rdf:dataytpe="nnn">September</month>
                   <year rdf:dataytpe="eee">2004</year>
               </Article>
           </man>
           <city rdf:dataytpe="ppp">September</city>
      </Manual>
   </art>


</Book>


</rdf:RDF>



Anybody can help me ?

Thank you, Regards

IZASKUN

Current Thread