RE: [xsl] Group nodes

Subject: RE: [xsl] Group nodes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 17 Jun 2008 12:42:48 +0100
Unfortunately I suspect you have oversimplified your problem. If it's really
as simple as this you can do

<xsl:template match="Book">
<Book>
  <xsl:copy-of select="@rdf:ID"/> 
  <xsl:copy-of select="address"/>
  <date>
    <Date>
      <xsl:copy-of select=".//month"/> 
      <xsl:copy-of select=".//year"/> 
    </Date>
  </date>
</Book>
</xsl:template> 

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

> -----Original Message-----
> From: IZASKUN GUTIERREZ GUTIERREZ 
> [mailto:igutierrez027@xxxxxxxxxxxxx] 
> Sent: 17 June 2008 12:34
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Group nodes
> 
> Hello everybody!
> 
> I have this XML :
> 
> <Book rdf:ID="boo">
>    <address>Almogavers 56</address>
>    <date>
>      <Date>
>          <month>January</month>
>      </Date>
>    </date>
>    <date>
>      <Date>
>          <year>2006</year>
>      </Date>
>    </date>
> </Book>
> 
> and I need group tags <month> and <year> like this:
> 
> <Book rdf:ID="boo">
>    <address>Almogavers 56</address>
>    <date>
>      <Date>
>          <month>January</month>
>          <year>2006</year>
>      </Date>
>    </date>
> </Book>
> 
> I need this result.
> 
> Anybody can help me?
> 
> Thank you, Regards
> 
> Izaskun

Current Thread