This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Stripping carriage returns
- To: xsl-list at mulberrytech dot com
- Subject: Re: Stripping carriage returns
- From: Mike Brown <mike at skew dot org>
- Date: Thu, 4 May 2000 10:20:09 -0600 (MDT)
- Reply-To: xsl-list at mulberrytech dot com
> I would then look at your stylesheet and look at the places where you
> have used Returns and spaces for formatting the stylesheet, some of
> these also get sent to the output.
The stylesheet is interpreted as a node tree just like the source tree.
Whitespace-only text nodes in the tree (which will be the whitespace that
occurs between most sections of markup) are removed, per the spec, prior
to processing. Text nodes that contain more than just whitespace are not
stripped.
Specifically, the things to look for are things like
<foo>
some non-whitespace character data
</foo>
...which is different than
<foo>some non-whitespace character data</foo>
To preserve indenting, either use the above style, or use xsl:text.
<foo>
<xsl:text>some non-whitespace character data</xsl:text>
</foo>
- Mike
___________________________________________________________
Mike J. Brown, software engineer, Webb Interactive Services
XML/XSL stuff: http://www.skew.org/ http://www.webb.net/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list