This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: needing clarification about XSL transformation
- From: Vitaly Ostanin <vyt at vzljot dot ru>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Mon, 03 Mar 2003 16:49:02 +0300
- Subject: DOCBOOK-APPS: Re: needing clarification about XSL transformation
- References: <Pine.LNX.4.44.0303021447070.5117-100000@dell>
On Sun, 02 Mar 2003 14:51:41 -0500 (EST)
"Robert P. J. Day" <rpjday at mindspring dot com> wrote:
>
> i spent the last hour trying to figure out why i was losing
> my PIs and comments in transforming my original XML source file
> to another XML format.
>
> my stripped-down stylesheet to isolate the problem was
>
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xsl:template match="@*">
> <xsl:copy/>
> </xsl:template>
>
> <xsl:template match="node()">
> <xsl:copy>
> <xsl:apply-templates select="@* | node()" />
> </xsl:copy>
> </xsl:template>
Try:
<xsl:template match="@*|comment()|processing-instruction()">
<xsl:copy/>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*|*"/>
</xsl:copy>
</xsl:template>
http://www.w3.org/TR/xslt#built-in-rule
IMHO, xsltproc - the best.
<skipped/>
--
Regards, Vyt
mailto: vyt at vzljot dot ru
JID: vyt at vzljot dot ru