RE: SVGT 1.2: A proposal for how to define SVG whitespace in terms of CSS whitespace

For better or worse, the rules for SVG 1.0/1.1 are that the XML parser
is not expected to do any special SVG-specific processing on text nodes,
no matter what the value is of xml:space, but instead that the SVG UA is
expected to collapse out white space within text nodes before SVG's
particular rules for single-line layout per
http://www.w3.org/TR/SVG11/text.html#WhiteSpace. Pay close attention to
the sentence:

"... These are behaviors that occur subsequent to XML parsing [XML10]
and any construction of a Document Object Model [DOM2]."

While there are probably thousands of better approaches to white space
handling than what was chosen for SVG 1.0/1.1, it is too late to change
them now (e.g., changing the default from "default" to "preserve"). Many
viewers, larger numbers of authoring tools, and even larger numbers of
SVG web pages have been written to follow the SVG 1.0/1.1 rules.

The time to change SVG's white space handling rules is when the W3C
mounts an effort to unify white space handling rules across its many
document formats (HTML/CSS, XSL-FO, SVG, MathML, XForms, ...), and once
the unified approach to white space handling is defined, all of the
formats, including SVG, should adopt the new rules. If/when such
unification is pursued seriously, I nominate the XSL-FO white space
properties for consideration.

Jon



-----Original Message-----
From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf
Of Maciej Stachowiak
Sent: Monday, January 30, 2006 7:07 PM
To: Ian Hickson
Cc: www-svg@w3.org
Subject: Re: SVGT 1.2: A proposal for how to define SVG whitespace in
terms of CSS whitespace



On Jan 30, 2006, at 3:34 PM, Ian Hickson wrote:

>
>
> (SVGWG, please consider this one of my last call comments.)
>
> On Sat, 14 Jan 2006, Maciej Stachowiak wrote:
>>
>> Here's my proposal for how to change this.
>>
>> * The default setting for xml:space for SVG elements is "preserve".
>
> I don't understand what this means. Since SVG 1.2 has no DTDs, it  
> can't
> default attributes, and XML 1.x provides no other mechanism for  
> changing
> the "default setting" of its attributes. (By default, xml:space is  
> not set
> on any elements, and inherits.)
>
> What you probably want to say is just that "all whitespace in the  
> markup
> must be preserved during parsing", without reference to xml:space  
> at all.
>
> Note that in existing XML parsers in Web UAs, xml:space has no effect,
> because the default value (unspecified), the "default" value, and the
> "preserve" value, all have the same effect. It would be extremely  
> bad for
> the SVG specification to require that XML parsers be aware of the SVG
> namespace when creating the DOM.

I that case, here's some alternate proposals:

A) When xml:space is not specified, the document should be preserve  
all whitespace, and in general act as specified for  
xml:space="preserve".

B) SVG could add a DTD or some other mechanism to set a default value  
for the attribute.

C) If xml:space="default" is defined to not modify the text in the  
DOM but only apply styling, then there is no need to set a default  
value or define what any of the values do to parsing.

Regards,
Maciej

Received on Tuesday, 31 January 2006 03:30:57 UTC