[xsl] preserving comments in xml through xslt

Subject: [xsl] preserving comments in xml through xslt
From: "Snyder, Christopher" <SnyderC@xxxxxxx>
Date: Fri, 26 Jan 2001 10:35:54 -0500
I'm using xslt to convert one xml document into another similar document
with a slightly different DTD, using a pretty basic identity transformation.

How do I refer to the comments in the first XML to be sure that they appear
in the finished XML?  They seem to be dissappearing.  I'm using ie5.0 with
the updated MSXML3.dll installed in replacement mode.

Additionally the root node of the input xml has an xmlns attribute which
doesn't want to show up in the finished xml.  Although I put an explicit
xsl:attribute command in for the root, it was still missing in the final

Thank you for your time,

The xsl looks like this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
<xsl:output method="xml" indent="yes"/>

   <!-- Transform a document to itself, lowercasing all tag names -->
   <!-- When you match any element -->
   <xsl:template match="*">
       <!-- Create the same element with a lowercase name -->
       <xsl:element name="{translate(name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
          <!-- Including any attributes it has and any child nodes -->
          <xsl:apply-templates select="node()|@*"/>

   <xsl:template match="@*">
      <xsl:attribute name="{translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
         <xsl:value-of select="current()"/>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread