This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: copy top-level comments
- To: bernward dot hanssen at db dot com
- Subject: [xsl] Re: copy top-level comments
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Date: Tue, 19 Jun 2001 04:41:28 -0700 (PDT)
- Cc: xsl-list at lists dot mulberrytech dot com
- Reply-To: xsl-list at lists dot mulberrytech dot com
Bernward Hanssen wrote:
> I want to copy comments from the input to the output.
> I try to get each command in a new Line as it is in the input document.
> <xsl:output method="xml" inden="yes"> works for the most comments, but not for the
> top.Level comments.
Using MSXML I cannot reproduce the problem:
source xml:
-----------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--comment1 -->
<!--comment2 -->
<doc>
<!-- comment1 ok -->
<!-- comment2 ok -->
</doc>
Stylesheet:
----------
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:copy-of select="//comment()" />
</xsl:template>
</xsl:stylesheet>
Result:
------
<!--comment1 -->
<!--comment2 -->
<!-- comment1 ok -->
<!-- comment2 ok -->
Cheers,
Dimitre Novatchev.
__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list