W3C home > Mailing lists > Public > www-di@w3.org > June 2004

Comments on DISelect 1.0 (WD 11 June 2004)

From: Paul Duffin <pduffin@volantis.com>
Date: Fri, 18 Jun 2004 12:53:16 +0100
Message-ID: <40D2D7AC.9000907@volantis.com>
To: www-di@w3.org

It appears (at least from the examples) that all the attributes are 
global, i.e. they have to be explicitly prefixed. While this is 
necessary for those attributes that can be added to elements from other 
namespaces it is unnecessary and confusing for the others. It will make 
it much more tedious and error prone for authors.

The following lists those attributes that should not be global.

sel:if
     expr

sel:select
     expr
     precept

sel:when
     expr

sel:variable
     name
     ref
     value

In fact the only attributes that need to be global are sel:expr and 
sel:selid when used on other elements.

I have a couple of use cases that do not appear to be satisfied by the 
current specification. It may be that these are actually issues for 
XHTML 2 or some other specification but they are related to content 
selection in some way.

Use Case 1 - Including
======================

Basically rather than duplicate these content selection expressions 
everywhere I want to store them in separate XML files and pull them in 
using XInclude or even external entities.
e.g.

     <xh2:body>
           :
         <xi:include href="image-selector.xml"/>
           :
     </xh2:body>

where image-selector.xml contains the following (note there is no 
<sel:otherwise>)

    <sel:select>
        ....
        <sel:when expr="...">
            <object ..../>
        </sel:when>
        ....
    </sel:select>

Does DISelect work with XInclude and if so how ?

Assume that I have a number of these selector files and want to combine 
them together so that if the first one does not select something then 
the next one will be tried and so on. (I know that XHTML 2 <object> does 
something similar but this may be necessary for selecting other non 
<object> content).
e.g.
     <xh2:body>
           :
         <sel:select>
             <xi:include href="video-selector.xml"/>
             <xi:include href="image-selector.xml"/>
             <xi:include href="text-selector.xml"/>

             <sel:otherwise>
             </sel:otherwise>
         </sel:select>
           :
     </xh2:body>

The above should try the rules in video selector first, then image, then 
text and finally use the otherwise. Ideally they should behave as if the 
<sel:when> elements were extracted and added in the containing element. i.e.

         <sel:select>
             <!-- sel:when from video-selector.xml -->
             <sel:when ..../>
             <sel:when ..../>
             <!-- sel:when from image-selector.xml -->
             <sel:when ..../>
             <sel:when ..../>
             <!-- sel:when from text-selector.xml -->
             <sel:when ..../>

             <sel:otherwise>
             </sel:otherwise>
         </sel:select>

Is this supported or would I have to use xi:include to only include the 
contents of the sel:select rather than the sel:select itself.

Use Case 2 - Grouping
=====================

I have an <object> and some associated text. If the object cannot be 
output on the device then I do not want the associated text to be output 
either.

What I could do is something like ?

     <sel:if expr="..check that object is to be rendered...">
         <object .../>
         <p>Some text</p>
     </sel:if>

However, that is not really feasible as the expression necessary to 
check that the object is to be rendered may be extremely complicated and 
in fact may be device dependent so not possible to express at all.

An alternative might be to provide a special selection mechanism that 
checks the result of processing some other markup (in this case the 
<object>) and branching depending on whether it 'does' anything.
e.g.
     <sel:condition>
         <object .../>
     </sel:condition>
     <sel:if-does-something>
         <p>Some text</p>
     </sel:if-does-something>

It might be better for XHTML 2 to do this it just depends whether this 
is specific to <object>, or whether it could apply to elements in general.
Received on Friday, 18 June 2004 07:53:23 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.29 : Thursday, 13 January 2005 12:13:53 GMT