xsl-list
[Top] [All Lists]

RE: [xsl] Effects of white space between xml elements

2009-02-23 18:16:06
Does white space between elements of an xml document effect 
the output of a transformation of that document?

In general yes.

If tags are nested properly, shouldn't white 
space and new lines in between elements be irrelevant?

No. Consider:

<p>He was <i>nearly<i> <i>twelve</i>.</p>

Note however that many products give you the option to get rid of
inter-element whitespace when processing the kind of XML where you don't
want it. You can control this from the stylesheet using xsl:strip-space.
MSXML, notoriously, gets rid of it by default, causing data such as the
example above to be rendered incorrectly.

(On page 1005 of my XSLT 2.0 book is a screen shot showing how the XML 1.0
Recommendation displays incorrectly in Internet Explorer as a direct result
of this).

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>