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

RE: preserving comments in xml through xslt

Subject: RE: preserving comments in xml through xslt
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 26 Jan 2001 16:03:28 -0000
xslt copy comment
> 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.

You can generate comments using <xsl:comment>, or using <xsl:copy> on a
comment node. Try

<xsl:template match="comment()"><xsl:copy/></xsl:template>


> Additionally the root node of the input xml has an xmlns
> attribute which doesn't want to show up in the finished xml.

Namespace nodes from the source document will be copied if you use
<xsl:copy> on the element node (which you aren't doing) or a literal result
element (which you aren't using). You are using <xsl:element name="{ --
string-expression -- }", if this expression returns a name containing a
prefix, the prefix must be declared by a namespace declaration _in the
stylesheet_.

Mike Kay


 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.