Req: Clarify text striping and consolidation of white space characters for nested xml:space.

Could the SVG specification clarify the handling of white space characters when
there are nested text elements that differ in their xml:space attribute.

When xml:space is 'default' the SVG specification requires the application to
'strip off all leading and trailing space characters', but also requires the
application to preserve leading and trailing white space characters when
xml:space is 'preserve'.  But what is expected when there are leading and trailing
white space characters defined in a mixture of elements with xml:space of 'preserve'
and 'default'?

When xml:space is 'default' the SVG specification requires the application to
'all contiguous space characters will be consolidated', but also requires the
application to preserve white space characters when xml:space is 'preserve'.
But what is expected when there are white space characters to consolidate that
are defined in a mixture of elements with xml:space of 'preserve' and 'default'?

Suggested clarification:
When stripping leading and trailing white space characters, or consolidating white
space characters, white space characters defined within a element with xml:space
of "preserve" are not stripped or consolidated and they are recognized as white space
characters for the purpose of stripping and consolidation and do not prevent the
stripping or consolidation of adjacent white space characters defined in elements
with xml:space="default".

Example:
Let 'P' represent a white space character defined in an element with xml:space of 'preserve'.
Let 'D' represent a white space character defined in an element with xml:space of 'default'.
Let 'T' represent non-space text characters.

Given the string "DPDPDTDDTPTDPTPDTDPDTPDPTDPDPD" the application will strip and consolidate
the white space characters to give the string: "PPTDTPTPTPTPTPPTPP"

The current practice of SVG viewers appears to be to preserve white space characters defined
within a xml:space="preserve" element even when mixed with adjacent whitespace characters
defined in elements with xml:space="default".  However the handling of white space characters
defined in elements with xml:space="default" varies widely when mixed with adjacent whitespace
characters defined in elements with xml:space="preserve".

Regards
Douglas Crosher

Received on Monday, 25 June 2007 07:16:06 UTC