W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Re: Substitution Groups and NonDeterminism

From: Jeni Tennison <jeni@jenitennison.com>
Date: Mon, 10 Dec 2001 12:09:42 +0000
Message-ID: <19393992153.20011210120942@jenitennison.com>
To: Mark Feblowitz <mfeblowitz@frictionless.com>
CC: "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>
Hi Mark,

> Am I correct that, if I have a Substitution Group as element content
> that I cannot place any of its members as succeeding siblings
> without triggering a nondeterminism? Is there a way around this
> (that doesn't force the succeeding sibling down into some further
> nested content)?

It's not *quite* as general as that. The reason that you have
non-determinism in your case is because (a) the choice from the
substitution group is repeated any number of times and (b) the
AttachmentReference element is optional. If the AttachmentReference
weren't optional, the validator would know that anything before the
AttachmentReference was from the choice arising from the substitution
group, and anything after should be the ShipToPartner element.

So one option would be to make the AttachmentReference element
required. If it sometimes doesn't hold any information (which is
presumably why it's optional) then you should make it nillable so that
you can have:

  <AttachmentReference xsi:nil="true" />

when the content of the AttachmentReference element doesn't matter.



Jeni Tennison
Received on Monday, 10 December 2001 07:09:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:54 UTC