Re: [xslt] LibXSLT adding annoying whitespace
- From: Liam Quin <liam holoweb net>
- To: xslt gnome org
- Subject: Re: [xslt] LibXSLT adding annoying whitespace
- Date: Tue, 12 Jun 2001 22:00:26 -0400
On Wed, Jun 13, 2001 at 03:36:37AM +0200, Thomas Broyer wrote:
> And in the HTML spec, B.3.1 Line Breaks
> <http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.1> :
> «SGML (see [ISO8879], section 7.6.1) specifies that a line break
> immediately following a start tag must be ignored, as must a line break
> immediately before an end tag. This applies to all HTML elements without
This does not include a newline after an end tag, and does not
include space either side of an empty tag (which is neither a start nor
an end tag in SGML).
Were it not so,
would be rendered as <p>helloworld</p> without a space, clearly incorrect.
> This means:
> is strictly equivalent to
> for any conforming user agent, so it isn't a bug of libxslt/libxml.
This happens to be true, but not for the reasons you mention...
The specs are complex to understand, and not at all clearly written. The
actual SGML rules for whitespace involve distinguishing elements that
can contain text (#PCDATA) and ones that cannot, as well as rules about
the start end end of their content.
In the example, <body> isn't allowed to contain text:
would be a very different document. Inserting "ignorable" spaces leads to:
Liam Quin - Barefoot in Toronto - email@example.com - http://www.holoweb.net/
Ankh: irc.sorcery.net www.valinor.sorcery.net irc.gnome.org www.advogato.org
Author, Open Source XML Database Toolkit, Wiley August 2000
Co-author: The XML Specification Guide, Wiley 1999; Mastering XML, Sybex 2001
] [Thread Prev