[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: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 26 Jan 2001 16:09:16 GMT
comments in xml
> How do I refer to the comments in the first XML to be sure that they appear
> in the finished XML? 


match="comment()"


>  They seem to be dissappearing.
They will anyway with some parsers (which are allowed to throw away
comments) (But I don't think this applies to msxsl)

> Additionally the root node of the input xml has an xmlns attribute 
Two errors or terminology there.
The root node is not the top level element it is the conceptual root of
the tree corresponding to the whole document, and not to any explicit
markup. Root nodes can't have attributes. Also to a namespace aware
system xmlns:x= is _not_ an attribute. In Xpath they do not produce
attribute nodes, but rather result in namespace nodes.
You can't generate namespace declarations using xsl:attribute.

To get the namespace copied, since you are using xsl-element, you just
need to use the remaining attribute of that:

instead of

 name="{translate(name(), 'A...

you could use something like:

 name="{translate(name(), 'A...
 namespace="namespace-uri())

David

 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.