Re: Leading/trailing whitespace

On Wed, 11 Jun 2003 21:21:16 +0200, you wrote:

>http://www.w3.org/TR/SVG11/text.html#WhiteSpace
>
>Note that unless xml:space="preserve" then leading and trailing
>whitespace is trimmed and contiguous whitespace is consolidated, in SVG.

The section of SVG 1.1 you reference above applies only to whitespace
within character data, not within attribute values. Indeed, the
xml:space attribute itself applies only to character data, not attribute
values (see http://www.w3.org/TR/REC-xml#sec-white-space).

XML's whitespace normalization rules for attribute values state that
leading/trailing whitespace within an attribute value is stripped
_unless_ the attribute is declared to be CDATA (see
http://www.w3.org/TR/REC-xml#AVNormalize).

All of the <length>-type attributes in SVG are CDATA (see
http://www.w3.org/TR/SVG11/svgdtd.html#DTD.1.2), so leading/trailing
whitespace will _not_ be stripped from those attributes, even by a
validating parser.

And so my question remains (restated): Many of the XML attribute
specifications in SVG 1.1 do not explicitly allow the presence of
leading/trailing whitespace in the attribute value. Should such
whitespace be implicitly allowed? That is, should an SVG processor
ignore leading/trailing whitespace in _all_ attribute values?

Steve Schafer
Fenestra Technologies Corp
http://www.fenestra.com/

Received on Thursday, 12 June 2003 00:43:28 UTC