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

Substitution Groups and NonDeterminism

From: Mark Feblowitz <mfeblowitz@frictionless.com>
Date: Fri, 7 Dec 2001 15:41:46 -0500
Message-ID: <4DBDB4044ABED31183C000508BA0E97F024D55B5@fcpostal.frictionless.com>
To: "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>
I believe I've encountered a problem with using Substitution Groups in a
particular way and wanted to verify that my understanding is correct:

I'd like to have a Substitution Group containing things of type Partner, and
to reference the abstract head in an element content definition:

<xs:element name="Partner" type="Partner" abstract="true"/>
<xs:element name="ShipToPartner" type="Partner"
substitutionGroup="Partner"/>
<xs:element name="ShipFromPartner" type="Partner"
substitutionGroup="Partner"/>
<xs:element name="BillToPartner" type="Partner"
substitutionGroup="Partner"/>
	
...

<xs:element name="TaxWitholdingExempt" type="TaxWitholdingExempt"
minOccurs="0"/>
<xs:element ref="Partner" maxOccurs="unbounded"/>
<xs:element name="AttachmentReference" type="AttachmentReference"
minOccurs="0"

I later would like to extend the element that references the Partner element
and append a ShipToPartner element. 


<xs:element name="TaxWitholdingExempt" type="TaxWitholdingExempt"
minOccurs="0"/>
<xs:element ref="Partner" maxOccurs="unbounded"/>
<xs:element name="AttachmentReference" type="AttachmentReference"
minOccurs="0"
<xs:element ref="ShipToPartner"/>

This appears to create a nondeterminism because a ShipToPartner could match
either the general reference in the Substitution Group or the specific one
at the end (past the generic reference). 

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

----------------------------------------------------------------------------
----
 
Mark Feblowitz                                   [t] 617.715.7231
Frictionless Commerce Incorporated     [f] 617.495.0188 
XML Architect                                     [e]
mfeblowitz@frictionless.com
400 Technology Square, 9th Floor 
Cambridge, MA 02139 
www.frictionless.com  
 
Received on Friday, 7 December 2001 15:42:27 GMT

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