RE: [ACTION 177] Preserve Space

Hi Shaun,

One typo: xml:space="preserve" should probably not be in the example for global.

(minor) Possible text tweak: In the text with the examples we use "whitespace... ...must be treated literally". I see what you mean, but it may be more clear to just say "whitespace characters... ...must be preserved."

One note: we never say anywhere what are the whitespace characters. Don't XML and HTML have different views on this?

Cheers,
-ys


-----Original Message-----
From: Shaun McCance [mailto:shaunm@gnome.org] 
Sent: Thursday, August 02, 2012 1:37 AM
To: public-multilingualweb-lt@w3.org
Subject: [ACTION 177] Preserve Space

I posted a call for consensus about Preserve Space a couple week ago. This is a more fleshed out text for the spec, with examples.

I didn't get feedback on the data category itself, but I think it's non-controversial. If nobody objects, I'll add this text to the draft after a few days.

================

= Definition

The Preserve Space data category indicates how whitespace should be handled in content. The possible values for the Preserve Space data category are "default" and "preserve" and carry the same meaning as the corresponding values of the xml:space attribute. The default value is "default".

= Implementation

The Preserve Space data category can be expressed with global rules, or locally using the xml:space attribute.

GLOBAL: The preserveSpaceRule element contains the following:

* A required selector attribute. It contains an XPath expression which selects the nodes to which this rule applies.

* A required space attribute with the value "default" or "preserve".

  Example ##: The Preserve Space data category expressed globally

  The preserveSpaceRule element specifies that whitespace in all
  verse elements must be treated literally.

  <book>
   <info>
    <its:rules xmlns:its="http://www.w3.org/2005/11/its" 
      its:version="2.0">
     <its:preserveSpaceRule selector="//verse" space="preserve"/>
    </its:rules>
   </info>
   <verse xml:space="preserve">
'Twas brillig, and the slithy toves
 Did gyre and gimble in the wabe;
All mimsy were the borogoves,
 And the mome raths outgrabe.
</verse>
  </book>

LOCAL: The xml:space attribute, as defined in section 2.10 of [XML 1.0], maps exactly to the Preserve Space data category.

  Example ##: The Preserve Space data category expressed locally

  The standard xml:space attribute specifies that the whitespace
  in the verse element must be treated literally.

  <book
    xmlns:its="http://www.w3.org/2005/11/its" 
    its:version="2.0">
   <verse xml:space="preserve">
'Twas brillig, and the slithy toves
 Did gyre and gimble in the wabe;
All mimsy were the borogoves,
 And the mome raths outgrabe.
</verse>
  </book>

Received on Thursday, 2 August 2012 05:51:33 UTC