[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
So I am very new to XSL and teaching myself as I go.
I am trying to transform and existing XML database to a new format.
The scrips works (see below), EXCEPT comments in the original file are not copied into the output file.
The individual database items are converted as I want them, but the comments are lost.
What do I need to do so that the original file comments also get copied to the output file?
Frank
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<xsl:text>
</xsl:text>
<aitags><xsl:text>
</xsl:text>
<xsl:for-each select="AsiaInfoDb/*">
<aitag><xsl:copy-of select="@*"/><xsl:attribute name="id"><xsl:value-of select="name()"/></xsl:attribute><xsl:value-of select="."/></aitag><xsl:text>
</xsl:text>
</xsl:for-each>
</aitags>
</xsl:template>
</xsl:stylesheet>
[xsl] Newbie wants comments too . . .
Subject: [xsl] Newbie wants comments too . . . From: Frank Merrow <fmerrow@xxxxxxxxxxxx> Date: Wed, 07 May 2008 13:45:18 -0700 |
So I am very new to XSL and teaching myself as I go.
I am trying to transform and existing XML database to a new format.
The scrips works (see below), EXCEPT comments in the original file are not copied into the output file.
The individual database items are converted as I want them, but the comments are lost.
What do I need to do so that the original file comments also get copied to the output file?
Frank
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<xsl:text>
</xsl:text>
<aitags><xsl:text>
</xsl:text>
<xsl:for-each select="AsiaInfoDb/*">
<aitag><xsl:copy-of select="@*"/><xsl:attribute name="id"><xsl:value-of select="name()"/></xsl:attribute><xsl:value-of select="."/></aitag><xsl:text>
</xsl:text>
</xsl:for-each>
</aitags>
</xsl:template>
</xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] best practices re xsl:{i, James A. Robinson | Thread | Re: [xsl] Newbie wants comments too, Wendell Piez |
Re: [xsl] output to iso-8859-1 of n, Robert Koberg | Date | Re: [xsl] Newbie wants comments too, Wendell Piez |
Month |