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

Invalid particle derivation by restriction (XMLSpy vs. MSXML4)

From: Dent, Andrew <aed5@cdc.gov>
Date: Tue, 26 Mar 2002 11:05:33 -0500 (EST)
Message-ID: <F0DEEE37B071D211AB210001FA12DAAF05412E4E@mcdc-atl-50.cdc.gov>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hello,

Quick question:  The following code validates in XMLSpy, but using MSXML4
(in VB) raises the following error:

Invalid particle derivation by restriction
Base Type {http://www.opengis.org/gml}GeometryCollectionType
Derived Type {http://www.opengis.org/gml}MultiLineStringType

I read elsewhere on this list that cardinality mismatches may be a problem,
but couldn't identify any here.  I also, completely removed the restriction
base for MultiLineString, and it validated in XMLSpy and MSXML4.

Any help that anyone has to offer would be greatly appreciated!

Thanks,

Andy Dent
Agency for Toxic Substances and Disease Registry

P.S.

The file is here:

<?xml version="1.0" encoding="UTF-8"?>
<!--  File: geometry.xsd  -->
<schema targetNamespace="http://www.opengis.net/gml"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified"
version="2.05">
	<annotation>
		<appinfo>geometry.xsd v2.05 2001-02</appinfo>
		<documentation xml:lang="en">
      GML Geometry schema. Copyright (c) 2001 OGC, All Rights Reserved.
    </documentation>
	</annotation>
	<!-- bring in the XLink attributes -->
	<import namespace="http://www.w3.org/1999/xlink"
schemaLocation="gml_xlinks.xsd"/>
	<!-- ==============================================================
       global declarations
  =================================================================== -->
	<element name="_Geometry" type="gml:AbstractGeometryType"
abstract="true"/>
	<element name="geometryMember" type="gml:GeometryAssociationType"/>
	<element name="LineString" type="gml:LineStringType"
substitutionGroup="gml:_Geometry"/>
	<element name="MultiLineString" type="gml:MultiLineStringType"
substitutionGroup="gml:_Geometry"/>

	<!-- coordinate elements -->
	<element name="coord" type="gml:CoordType"/>
	<element name="coordinates" type="gml:CoordinatesType"/>
	<!-- this attribute gives the location where an element is defined
-->
	<attribute name="remoteSchema" type="anyURI"/>
	<!-- ==============================================================
       abstract supertypes
  =================================================================== -->
	<complexType name="AbstractGeometryType" abstract="true">
		<annotation>
			<documentation>
        All geometry elements are derived from this abstract supertype; 
        a geometry element may have an identifying attribute ('gid'). 
        It may be associated with a spatial reference system.
      </documentation>
		</annotation>
		<attribute name="gid" type="ID" use="optional"/>
		<attribute name="srsName" type="anyURI" use="optional"/>
	</complexType>
	<complexType name="AbstractGeometryCollectionBaseType"
abstract="true">
		<annotation>
			<documentation>
        This abstract base type for geometry collections just makes the 
        srsName attribute mandatory.
      </documentation>
		</annotation>
		<complexContent>
			<restriction base="gml:AbstractGeometryType">
				<attribute name="gid" type="ID"
use="optional"/>
				<attribute name="srsName" type="anyURI"
use="required"/>
			</restriction>
		</complexContent>
	</complexType>
	<attributeGroup name="AssociationAttributeGroup">
		<annotation>
			<documentation>
        These attributes can be attached to any element, thus allowing it 
        to act as a pointer. The 'remoteSchema' attribute allows an element 
        that carries link attributes to indicate that the element is
declared 
        in a remote schema rather than by the schema that constrains the 
        current document instance.  
      </documentation>
		</annotation>
		<attributeGroup ref="xlink:simpleLink"/>
		<attribute ref="gml:remoteSchema" use="optional"/>
	</attributeGroup>
	<complexType name="GeometryAssociationType">
		<annotation>
			<documentation>
        A geometryMember encapsulates any primitive geometry element. 
        Alternatively, it can function as a simple link that points to a 
        remote geometry.
      </documentation>
		</annotation>
		<sequence>
			<element ref="gml:_Geometry" minOccurs="0"/>
		</sequence>
		<attributeGroup ref="gml:AssociationAttributeGroup"/>
	</complexType>
	<!-- ==============================================================
       primitive geometry types
  =================================================================== -->
	<complexType name="LineStringType">
		<annotation>
			<documentation>
        A LineString is defined by two or more coordinate tuples, with 
        linear interpolation between them. 
      </documentation>
		</annotation>
		<complexContent>
			<extension base="gml:AbstractGeometryType">
				<sequence>
					<choice>
						<element ref="gml:coord"
minOccurs="2" maxOccurs="unbounded"/>
						<element
ref="gml:coordinates"/>
					</choice>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
	<!-- ==============================================================
       aggregate geometry types
  =================================================================== -->
	<complexType name="GeometryCollectionType">
		<annotation>
			<documentation>
        A geometry collection must include one or more geometries,
referenced 
        through geometryMember elements. User-defined geometry collections 
        that accept GML geometry classes as members must instantiate-or 
        derive from-this type.
      </documentation>
		</annotation>
		<complexContent>
			<extension
base="gml:AbstractGeometryCollectionBaseType">
				<sequence>
					<element ref="gml:geometryMember"
maxOccurs="unbounded"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
	<complexType name="MultiLineStringType">
		<annotation>
			<documentation>
        A MultiLineString is defined by one or more LineStrings, referenced 
        through lineStringMember elements.
      </documentation>
		</annotation>
		<complexContent>
			<restriction base="gml:GeometryCollectionType">
				<sequence>
					<element name="lineStringMember"
maxOccurs="unbounded">
						<complexType>
							<sequence>
								<element
ref="gml:LineString"/>
							</sequence>
						</complexType>
					</element>
				</sequence>
			</restriction>
		</complexContent>
	</complexType>
	
	<!-- ==============================================================
       There are two ways to represent coordinates: (1) as a sequence 
       of <coord> elements that encapsulate tuples, or (2) using a 
       single <coordinates> string.
  =================================================================== -->
	<complexType name="CoordType">
		<annotation>
			<documentation>
        Represents a coordinate tuple in one, two, or three dimensions.
      </documentation>
		</annotation>
		<sequence>
			<element name="X" type="decimal"/>
			<element name="Y" type="decimal" minOccurs="0"/>
			<element name="Z" type="decimal" minOccurs="0"/>
		</sequence>
	</complexType>
	<complexType name="CoordinatesType">
		<annotation>
			<documentation>
        Coordinates can be included in a single string, but there is no 
        facility for validating string content. The value of the 'cs'
attribute 
        is the separator for coordinate values, and the value of the 'ts' 
        attribute gives the tuple separator (a single space by default); the

        default values may be changed to reflect local usage.
      </documentation>
		</annotation>
		<simpleContent>
			<extension base="string">
				<attribute name="decimal" type="string"
use="optional" default="."/>
				<attribute name="cs" type="string"
use="optional" default=","/>
				<attribute name="ts" type="string"
use="optional" default="&#x20;"/>
			</extension>
		</simpleContent>
	</complexType>
</schema>
Received on Wednesday, 27 March 2002 04:22:56 GMT

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