XSD 1.1: ancestors and <input>

Group, (cc'd to Forms WG as interesting, and related)

We have an outstanding review of XSD 1.1 due, but I have been asked for  
our opinion on a particular facet:

XSD 1.1 adds assertions to its repertoire:

   <simpleType name="string.8">
    <restriction base="string">
     <assert test="string-length($value) mod 8 = 0"/>
    </restriction>
   </simpleType>

   <complexType name="even-dozens">
    <assert test="count(*) mod 12 = 0"/>
   </complexType>

However, it only allows such assertions to refer to the element and its  
children, not to ancestors (I haven't fully understood why yet).

However, there are use cases where if you want to specify the true  
restrictions on an element, you need to refer to its ancestors. And it  
happens that the (X)HTML <input> element is the poster child of such  
restrictions: it must be the child of a <form> element.

There have been tricks suggested that allow you to fake the restriction,  
such as testing this on <body>:

   count(.//input) = count(.//form//input)

but you can't put this test where it needs to be, namely in the module  
that defines <input> (and really, it is a trick).

The question that has been put to us is, can we live with this, or do we  
object?

I have put it on the agenda for this afternoon.

Steven

Received on Wednesday, 27 August 2008 10:01:16 UTC