xsl-list
[Top] [All Lists]

[xsl] Newbie wants comments too . . .

2008-05-07 13:45:53
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-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>