You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Lyle Coder <x_...@hotmail.com> on 2001/01/04 01:41:30 UTC

Best XSL to copy a source document

Hi,
Is this really the best way to copy a source XML file with out any changes
or transformations to the output?

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
        <xsl:template match="/">
                <xsl:apply-templates/>
        </xsl:template>
        <xsl:template match="node()">
                <xsl:copy>
                        <xsl:for-each select="attribute::*">
                                <xsl:attribute name="{name(.)}">
                                        <xsl:value-of select="."/>
                                </xsl:attribute>
                        </xsl:for-each>
                        <xsl:apply-templates/>
                </xsl:copy>
        </xsl:template>
</xsl:stylesheet>


Thanks
Lyle