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:

  ...
  <Partner>...</Partner>
  <AttachmentReference xsi:nil="true" />
  <ShipToPartner>...</ShipToPartner>
  ...

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

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Monday, 10 December 2001 07:09:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:25 GMT