W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2007

[whatwg] xml:space

From: liorean <liorean@gmail.com>
Date: Tue, 23 Jan 2007 16:45:15 +0100
Message-ID: <cee13aa30701230745m261f8935hd4f96520e7e71d64@mail.gmail.com>
On 1/23/07, Henri Sivonen <hsivonen at iki.fi> wrote:
> On Jan 22, 2007, at 23:57, Ian Hickson wrote:
> > It's automatically conforming everywhere, no? Isn't it an XML thing?
> It is an XML thing. XML 1.0 4th ed. says:
> > A special attribute named xml:space may be attached to an element
> > to signal an intention that in that element, white space should be
> > preserved by applications. In valid documents, this attribute, like
> > any other, MUST be declared if it is used. When declared, it MUST
> > be given as an enumerated type whose values are one or both of
> > "default" and "preserve".
> http://www.w3.org/TR/REC-xml/#sec-white-space
> So the vocabularies that have a DTD and wish to use the attribute
> must declare it in the DTD. For DTDless vocabularies, it doesn't
> exactly say whether the vocabularies should explicitly allow the
> attribute, but explicitly allowing it leaves no ambiguity.

Well, considering the purpose of XHTML (main purpose is presentation
for humans, no?) is there any reason to NOT just set it to default to
"preserve" on the html element, fixed to "preserve" on the script,
style, pre and textarea elements and have it implied through an entity
for all other elements? Style sheets can change whether presentation
of whitespace is collapsed or not. By default, the whitespace is
collapsed but for the pre element it's conserved, but that can
overridden by user or author style sheets. But whitespace that is
structurally collapsed at the XML level cannot be restored for
presentation by the style sheet, so this whitespace is lost from ever
being presented as it appeared in the document.
David "liorean" Andersson
Received on Tuesday, 23 January 2007 07:45:15 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:51 UTC