- From: Shaun McCance <shaunm@gnome.org>
- Date: Wed, 01 Aug 2012 19:37:25 -0400
- To: public-multilingualweb-lt@w3.org
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 Wednesday, 1 August 2012 23:37:50 UTC