Re: Using assert in a complexType with complexContent

I could imagine that constraints of "assert" are orthogonal to the
effects of XSD complex type extension. I think, XSD extension means
that we *add* some content model features to the derived types (for
e.g more particles or more features to non particle XSD components) in
addition to the features inherited from the base type. "assert" can
impose certain constraints on the XML fragment tree rooted at the
element, which is validated by the complex type (and this appears to
me an orthogonal effect than the structural constraints like sequence,
choice or all). The XSD 1.1 spec says, that asserts are there to
implement co-occurrence constraints (i.e some aspect of an XML tree
can influence the content model of other parts of the XML tree), and
there is nothing in this goal to propose something like extending a
content model.

On Fri, Nov 4, 2011 at 5:33 AM, Michael Kay <mike@saxonica.com> wrote:
> 'assert' can appear as the last child of 'extension'.
>
> I'm afraid that the logic of the syntax for complex types defeats me totally
> - don't ask me to explain it, let alone to justify it. I'm not really sure
> why we allow assert to appear on types derived by extension, since the
> effect of assert is to restrict rather than to extend; I suppose one can
> justify it on the grounds that you might want to impose constraints on the
> content of the extension.
>
> Michael Kay
> Saxonica




-- 
Regards,
Mukul Gandhi

Received on Friday, 4 November 2011 09:45:38 UTC