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

Unions and Enumerations

From: Snow, Corey <CSNOW@ddpwa.com>
Date: Wed, 3 Apr 2002 14:00:32 -0800
Message-ID: <200204032200.g33M0Xa12826@thumper.deltadentalwa.org>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
I have a situation here that I'm not sure is due to a problem with my schema
or something to do with the MSXML Parser.

I have an XML schema that includes the following:

<xs:simpleType name="USStatesAbbreviationsEnum">
	<xs:restriction base="xs:string">
		<xs:enumeration value="AK"/>
		<xs:enumeration value="AL"/>
		<xs:enumeration value="AR"/>
		<xs:enumeration value="AZ"/>
		...remainder snipped for brevity
	</xs:restriction>
</xs:simpleType>
<xs:simpleType name="USStatesNamesEnum">
	<xs:restriction base="xs:string">
		<xs:enumeration value="Alaska"/>
		<xs:enumeration value="Alabama"/>
		<xs:enumeration value="Arkansas"/>
		<xs:enumeration value="Arizona"/>
		<xs:enumeration value="California"/>
		...remainder snipped for brevity
	</xs:restriction>
</xs:simpleType>

<xs:simpleType name="USStatesUnion">
	<xs:union memberTypes="USStatesAbbreviationsEnum
USStatesNamesEnum"/>
</xs:simpleType>

Seems pretty straightforward, or at least I think it does. This construct
validates in XML Spy 4 as well as does the rest of the schema this is
contained in.

This schema is actually just my "datatypes" schema, and has no namespace
associated with it. I have a "master.xsd" schema, which includes this schema
as well as several others, and has a target namespace associated with it.
(note: some of the documents that "master.xsd" includes also include the
"datatypes.xsd" themselves, but changing this makes no difference to the
error.)

I also get this error when I attempt to load the schema directly, without
going to the "master.xsd" file. It occurs when I attempt to add the schema
to an XMLSchemaCache object.

When i attempt to add the schema to an XMLSchemaCache object, I get an error
that says "USStatesAbbreviationsEnum" refers to an undeclared XSD type. If I
reverse the order of the two "memberTypes" in the "xs:union" element, the
error references the other enumeration- basically it barfs on whichever one
comes first.

I have validated my schema using XSV and XML Spy with no problems, but I'm
still not sure this isn't a problem with my schema design. Can anyone offer
any pointers and/or resources I could look into? I've searched the MS KB and
Google to no avail, although I'm going back to do some more searching now.
If this is a parser problem and not an schema issue, I'll go elsewhere for
questions, as this list isn't really about MSXML per se.

Regards,

Corey Snow


#########################################################
The information contained in this e-mail and subsequent attachments may be privileged, 
confidential and protected from disclosure.  This transmission is intended for the sole 
use of the individual and entity to whom it is addressed.  If you are not the intended 
recipient, any dissemination, distribution or copying is strictly prohibited.  If you 
think that you have received this message in error, please e-mail the sender at the above 
e-mail address.
#########################################################
Received on Wednesday, 3 April 2002 17:01:05 GMT

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