Subject: Posted PaceTextRules

From: Graham <[email-masked]>
Date: Mon, 31 Jan 2005 01:00:57 +0000

http://www.intertwingly.net/wiki/pie/PaceTextRules

-Abstract

Tighten up rules on processing text to ensure interop between apps

-Status

Open

-Rationale

Plain text may be interpreted and displayed in various different ways. 
Similarly text in the source may be formatted in many different ways. 
Clear rules are required to remove the possibility of disputes between 
publishers to avoid disputes over how text is formatted in the source 
and how it is displayed.

-Proposal

Add "xml:space attributes appearing on Text constructs or their parents 
MAY be ignored by processors" to 3.1 Text Constructs.

  Replace "Thus, software MAY display it using normal text rendering 
techniques such as proportional fonts, white-space collapsing, and 
justification." with "Software displaying this text SHOULD remove 
white-space at the beginning and end; collapse white-space between 
words; and disregard line break, tab and other formatting characters." 
in 3.1.1 (TEXT).

  Add "xml:space directives appearing on atom:content or its parents MAY 
be ignored by processors" to 4.15 atom:content.

  Replace "Thus, software MAY display it using normal text rendering 
techniques such as proportional fonts, white-space collapsing, and 
justification." with "Software displaying this text SHOULD remove 
white-space at the beginning and end; collapse white-space between 
words; and disregard line break, tab and other formatting characters." 
in 4.15.3 (TEXT).

-Impacts

None

-Notes

Some formal definition of whitespace etc may be needed.

---

From: Tim Bray <[email-masked]>
Date: Sun, 30 Jan 2005 17:43:40 -0800

On Jan 30, 2005, at 5:00 PM, Graham wrote:

> -Proposal
>
> Add "xml:space attributes appearing on Text constructs or their 
> parents MAY be ignored by processors" to 3.1 Text Constructs.

Currently, the draft says *nothing* about xml:space (unless I'm 
mis-using the search function).  If you read the specification for 
xml:space (http://www.w3.org/TR/REC-xml/#sec-white-space), all it says 
is that this is a message from the author to downstream software.  So 
there is nothing anywhere that says anything normative about xml:space. 
  Thus, nobody has any standing, or reasonable grounds for expectation, 
that inserting an xml:space necessarily causes any downstream behavior. 
  Thus, I'm not sure why this assertion is necessary; and it feels kind 
of weird.

Is the point here to tell them that if they want to control the 
formatting, they should damn well use type="HTML" or "XHTML"?  If so, 
maybe we should spin the language around and say that:

  When type="TEXT", receiving software has a great deal of freedom in
  how it chooses to display the content.  Thus, publishers who want
  to exercise formatting control should use the values "HTML" or
  "XHTML" for the type attribute

Would that do it, Graham?

> words; and disregard line break, tab and other formatting characters." 

No opinion on this. --Tim

---

From: Graham <[email-masked]>
Date: Mon, 31 Jan 2005 02:11:44 +0000

On 31 Jan 2005, at 1:43 am, Tim Bray wrote:

> there is nothing anywhere that says anything normative about 
> xml:space.  Thus, nobody has any standing, or reasonable grounds for 
> expectation, that inserting an xml:space necessarily causes any 
> downstream behavior.  Thus, I'm not sure why this assertion is 
> necessary; and it feels kind of weird.

That didn't stop Blogger trying to do some dead weird stuff with it. An 
excerpt from the first Google result for such is:

<summary type="application/xhtml+xml" 
xml:base="http://home.earthlink.net/~beyonddeadline/" 
xml:space="preserve">
<div xmlns="http://www.w3.org/1999/xhtml">So you read in the newspaper 
that a $59 gizmo can be used to harass and endanger the lives of 
pilots, including those flying police helicopters. Do you:

a)	Say to yourself “how terrible” and move on to the comics.
b)	Wonder aloud if your friend who uses one of these things in 
corporate presentations knows about this?
c)	Think to yourself about the irony of an aircraft that cost thousands 
of</div>
</summary>

It's the line breaks that are the worst. Maybe the spec they need 
pointing to is the xml:space one and not something added to Atom.

Graham

---

From: Henri Sivonen <[email-masked]>
Date: Mon, 31 Jan 2005 10:09:21 +0200

On Jan 31, 2005, at 03:00, Graham wrote:

> "Software displaying this text SHOULD remove white-space at the 
> beginning and end; collapse white-space between words; and disregard 
> line break, tab and other formatting characters." in 3.1.1 (TEXT).

+1 with the minor nit that lone line breaks should be considered 
spaces--not disregarded. Thus: Software displaying this text SHOULD 
remove white-space at the beginning and end; and treat sequences of one 
or more XML white-space characters as a single space.

-- 
Henri Sivonen
[email-masked]
http://iki.fi/hsivonen/

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Mon, 31 Jan 2005 14:37:41 +0100

>there is nothing anywhere that says anything normative about xml:space.

http://www.w3.org/MarkUp/2004/xhtml-faq#xmlspace cites a quite different
opinion on this matter...

>  "XHTML" for the type attribute

It would seem authors expect that

  <atom:foo type = 'TEXT' xml:space = 'preserve'>...</atom:foo>

gets rendered as if it were

  <atom:foo type = 'XHTML' xml:space = 'preserve'>
    <xhtml:div><xhtml:pre>...</xhtml:pre></xhtml:div>
  </atom:foo>

What's the point of allowing such random results?
-- 
Björn Höhrmann · mailto:[email-masked] · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/

---

From: Tim Bray <[email-masked]>
Date: Mon, 31 Jan 2005 07:38:19 -0800

On Jan 31, 2005, at 5:37 AM, Bjoern Hoehrmann wrote:

>> xml:space.

Yes, well that opinion is (a) specific to HTML and (b) wrong.  I'm 
amazed that the W3C allowed that to be published.  -Tim