W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2012

Re: Supporting incremental-definition of a type?

From: Mukul Gandhi <gandhi.mukul@gmail.com>
Date: Mon, 18 Jun 2012 22:20:52 +0100
Message-ID: <CABuuzNMYfohFxfNxH5d2UA9dCKZiZWMA7KYWRhCwKgM3VXRynQ@mail.gmail.com>
To: Michael Kay <mike@saxonica.com>
Cc: xmlschema-dev@w3.org
Hi Mike,
   I wish, assertions allowed you to define a schema for XSLT as you
want. But I believe, XSD assertions have other many uses than defining
the schema for XSLT :)

On Mon, Jun 18, 2012 at 9:53 PM, Michael Kay <mike@saxonica.com> wrote:
> I think it would have been much better if we had allowed assertions to be
> defined within an <xs:extension>

I think, this is allowed presently by the XSD 1.1 language. Following
are the relevant grammar fragments of the XSD complexType (copied from
the spec),

     id = ID
     mixed = boolean
     {any attributes with non-schema namespace . . .}>
     Content: (annotation?, (restriction | extension))

    base = QName
    id = ID
    {any attributes with non-schema namespace . . .}>
    Content: (annotation?, openContent?, ((group | all | choice |
sequence)?, ((attribute | attributeGroup)*, anyAttribute?), assert*))

It seems, an xs:assert in complexType xs:extension has the same
semantic meaning as an xs:assert within xs:restriction (i.e a
orthogonal co-occurrence constraint in addition to the content model
derivation constraint).

Mukul Gandhi
Received on Monday, 18 June 2012 21:21:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:16:01 UTC