Re: Supporting incremental-definition of a type?

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),

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

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

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).



-- 
Regards,
Mukul Gandhi

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