Re: [ACTION 177] Preserve Space

On Thu, 2012-08-02 at 06:57 +0200, Felix Sasaki wrote:
> Hi Shaun,
> 
> 2012/8/2 Shaun McCance <shaunm@gnome.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.
> 
> 
> In the example below, isn't the information of the global rule and the
> local xml:space attribute redundant? That is, wouldn't the global rule
> work without the xml:space attribute at the "verse" element?

Yes. Copy and paste error. I wrote the local version first, copied
it and added the global rule, and forgot to drop the attribute.

>           <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>
>         
>         
>         
>         
> 
> 
> 
> 
> -- 
> Felix Sasaki
> DFKI / W3C Fellow
> 

Received on Thursday, 2 August 2012 05:01:48 UTC