This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: preserving comments in xml through xslt


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]