W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

Substitution group with members having simpleContent or complexCo ntent

From: Mark Feblowitz <mfeblowitz@frictionless.com>
Date: Thu, 24 Jan 2002 17:56:16 -0500
Message-ID: <4DBDB4044ABED31183C000508BA0E97F024D5786@fcpostal.frictionless.com>
To: "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>

Is there any way that I could define a type, e.g., 

	<xs:complexType name="ItemId" abstract="true"/>

and then derive two extensions, one with simpleContent (specifically, of
type xs:string) and one of complexType?

It would be simple enough to define two separate types and be done with it.
What I'm really after is a substitution group with a head that is of the
above type, but which has derivations that are either contain simpleContent


or complexContent 

	<MyComplexItemId><Name/><Address/></ MyComplexItemId>

The only way I can think to do it would be to declare the MySimpleItemId
type to have simpleContent and extend ItemId, and have a mixed="true" to
allow text:

	<xs:complexType name="MySimpleItemId" mixed="true">
			<xs:extension base="ItemId"/>

 The MyComplexItemId type could have complexContent and also extend ItemId,
building out the complexContent as  usual:

	<xs:complexType name="MyComplexItemId">
			<xs:extension base="ItemId">
					<xs:element name="Revision"
type="Revision" minOccurs="0"/>
					<xs:element name="Code" type="Name"

This seems like a hack, but appears to me to be the only way to have a
substitution group have members that are of different contentTypes.

A choice group could do the trick, but I'd like the group to have
substitution group extensibility. Is this possible?

Any better ideas?



Mark Feblowitz                                   [t] 617.715.7231
Frictionless Commerce Incorporated     [f] 617.495.0188 
XML Architect                                     [e]
400 Technology Square, 9th Floor 
Cambridge, MA 02139 
Received on Thursday, 24 January 2002 17:56:48 UTC

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