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

Re: Re: copy top-level comments

Subject: Re: Re: copy top-level comments
From: "Rob Lugt" <roblugt@xxxxxxxxx>
Date: Tue, 19 Jun 2001 13:24:28 +0100
Re:  Re: copy top-level comments
Dimitre Novatchev 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>
>

I'm afraid this looks like a non-conformance issue with MSXML.  The space
between the comments in the root node is not XML character data, and
therefore I don't think it should be presented to the XSLT processor as
such.

However, it is possible to achieve what Bernward wanted with a modified
stylesheet:-

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/comment()">
        <xsl:text>&#10;</xsl:text> <!-- force a linefeed before each
top-level comment -->
        <xsl:copy/>
    </xsl:template>

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

</xsl:stylesheet>

Regards,
Rob

--
Rob Lugt
ElCel Technology
http://www.elcel.com




 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.