W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2005

inconsistent results

From: Serkant Karaca <skaraca@internetteyim.net>
Date: Fri, 21 Oct 2005 23:59:10 +0300
Message-ID: <002701c5d682$4955a7d0$5b18d751@ankara>
To: <xmlschema-dev@w3.org>
I am getting inconsistent results from various validating parsers based on 
importing/including declaring an element as a simpleType that is created 
based on a union in a schema with no namespace.

Is it possible to define a simpleType using a union and specifying 
memberTypes without assigning a namespace?

I start with a schema with nonamespace that defines three simpleTypes the 
third being a union of the first two.  I include this within another schema 
that has a namespace and then access the union type definition 
"usZipOrCanadaPostal" (see below).  Both XSV and Xerces validate schema 
with this arrangement.  XMLSPY also validates with no error.  However, 
MSXML complains that it cannot find the two memberType definitions.


<xsd:simpleType name="usZip">
   <xsd:restriction base="xsd:string">
     <xsd:pattern value="[0-9]{5}(-[0-9]{4})?"/>

<xsd:simpleType name="canadaPostal">
   <xsd:restriction base="xsd:string">
     <xsd:pattern value="([A-Za-z]\d[A-Za-z]( |-)\d[A-Za-z]\d)"/>

<xsd:simpleType name="usZipOrCanadaPostal">
   <xsd:union memberTypes="usZip canadaPostal"/>


This is the schema that includes the definitions.  It is considered valid 
in XSV, Xerces, and XMLSPY but not MSXML 4.0:


<xsd:include schemaLocation="testComponent.xsd"/>

<xsd:element name="Address" type="AddressType"/>
  <xsd:complexType name="AddressType">
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="Street" type="xsd:string"/>
    <xsd:element name="City" type="xsd:string"/>
    <xsd:element name="StateProvince" type="xsd:string"/>
    <xsd:element name="Country" type="xsd:string"/>
    <xsd:element name="PostalCode" type="usZipOrCanadaPostal"/>

Also, If I alter the schema structure slightly so that I import (instead of 
include) the same type definitions (via a proxy schema),  MSXML still 
returns an error, XMLSPY now returns an error of an "unidentified value for 
memberTypes" and XSV and Xerces continue to validate without errors.

Serkant KARACA
Senior Software Engineer
Received on Friday, 21 October 2005 20:59:10 UTC

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