Re: How to scope the note about D and override(E,D)

On Mar 14, 2011, at 8:24 AM, Henry S. Thompson wrote:

> [second of two replies]
> ...
> As a litmus test of the alleged value of this, I'm curious what you
> believe to be the case wrt the test over024, which its contributor
> Mike Kay classifies as 'invalid'.  Algorithm O classifies it as valid
> (as far as override is concerned, that is - I'm assuming zuludate was
> meant to be zuluDate, but that's irrelevant as regards the issue at
> hand), with two components:

> element 'doc' of type zuludate
> simpleType 'zuluDate' a restriction of xs:time

Test group over024 involves two schema documents, which I'll call P
(over024.bad.xsd) and Q (over024a.xsd).

  P overrides Q with E1.
  P declares simple type zuluDate as a restriction of date.

  Q declares element doc with an anonymous type.
  Q overrides P with E2.

  E1 declares element doc with type zuludate.
  E2 declares simple type zuluDate as a restriction of time.

Test over024.bad.xsd specifies that the schema to be used is the
schema corresponding to P. We start with the usual rule: the schema
corresponding to any schema document D is the union of the built-ins,
the components immediately declared in D, and the 'indirect'
components of the schema, which are present because D refers to other
schema documents.

  schema(P) = b + immed(P) + ind(P)

In this case, immed(P) consists of zuluDate as a restriction of date,
and ind(P) is the schema corresponding to the override of Q with E1:

            = b + simpletype(zuluDate restricts date using pattern ...) 
              + schema(override(E1,Q))

The last term expands using the same basic rule as we've already
applied:

            = b + simpletype(zuluDate restricts date using pattern ...) 
              + b + immed(override(E1,Q)) + ind(override(E1,Q))

The only immediate component of the override of Q by E1 is element doc
as zuludate, and the indirect components of override(E1,Q) are those
in the schema corresponding to the override of P by the overlay of E2
by E1. Let E2' be that overlay; it will contain declarations for
element doc and simple type zuluDate.
 
            = b 
              + simpletype(zuluDate restricts date using pattern ...) 
              + element(doc as zuludate) 
              + override((E2',P))
 
The override of P by E2' declares zuluType as a restriction of time
and overrides Q with an element whose children are those of E2', or
equivalent to them, depending on one's views about XML element
identity.  We expand the last term using the same triple as usual:

            = b 
              + simpletype(zuluDate restricts date using pattern ...) 
              + element(doc as zuludate) 
              + b
              + immed(override(E2',P))
              + ind(override((E2',P))

Before we bother about the last term, we expand the penultimate term:

            = b 
              + simpletype(zuluDate restricts date using pattern ...) 
              + element(doc as zuludate) 
              + b
              + simpletype(zuluDate restricts time using pattern ...)
              + ind(override((E2',P))

Since we have duplicate top-level declarations for type zuluDate, the
schema does not conform to the spec.

If we had started from Q, calculating schema(Q), we would have run
into an analogous difficulty with duplicate top-level declarations of
the element 'doc'.


-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************

Received on Monday, 14 March 2011 18:34:04 UTC