Subject: RE: Generally appending XML document to another one (using XSL)
From: Americo Albuquerque <melinor@xxxxxxxx>
Date: Thu, 2 Oct 2003 00:20:50 +0100
|
Hi
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Aitor San Juan
> Sent: Wednesday, October 01, 2003 8:41 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Generally appending XML document to another
> one (using XSL)
>
>
> Hello all!
>
> I am trying to write an XSL as general as possible to
> append documents at the end of others. You can see the XML
> input file and the XSL I'm working on. The "root" attribute
> of the <append> element is the name of the root element to be
> kept in the output, and under which all the child elements
> are appended. Let me explain myself with the following examples.
>
Try this:
<xsl:template match="append">
<xsl:element name="{@root}">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="file">
<xsl:apply-templates select="document(.)"/>
</xsl:template>
<xsl:template match="book">
<xsl:copy-of select="."/>
</xsl:template>
Regards,
Americo Albuquerque
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|