[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

preserving comments in xml through xslt

Subject: preserving comments in xml through xslt
From: "Snyder, Christopher" <SnyderC@xxxxxxx>
Date: Fri, 26 Jan 2001 10:35:54 -0500
xslt identity transformation comments
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
xml.

Thank you for your time,
Chris

The xsl looks like this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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',
 
'abcdefghijklmnopqrstuvwxyz')}">
          <!-- Including any attributes it has and any child nodes -->
          <xsl:apply-templates select="node()|@*"/>
       </xsl:element>
   </xsl:template>


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

</xsl:stylesheet>

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.