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

Derived type/Base type problem

From: Julian Broudou <julian.broudou@world.net>
Date: Mon, 28 Apr 2003 11:33:55 +1000
Message-ID: <6416776FCC55D511BC4E0090274EFEF50337060E@exchange.world.net>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

Hi,
I have a problem extending types I have already created.
I've declared a base type called "typeOrganisation" which is then used by
more than one schema.This type contains elements and attributes common to
all schemas. Each one of these other schemas can then extend the
typeOrganisation type to create their own types.

Now the example below validates Ok using XML Spy 5, but using MSXML4 I get
the following error.
"Derived Type and Base Type must have the same content Type".

Can someone tell me if what I'm doing is wrong?



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified" >
	<xs:include schemaLocation="TXML_COMMON.xsd"/>
	<xs:element name="TXML_PER">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Organisation"
type="Organisation" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>


	<xs:complexType name="Organisation">
		<xs:complexContent>
			<xs:extension base="typeOrganisation">
				<xs:sequence>
					<xs:element name="Person"
type="typePerson" minOccurs="0" maxOccurs="3"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>


	<xs:complexType name="typeOrganisation" mixed="true">
		<xs:sequence>
			<xs:element name="OrganisationName" minOccurs="0">
				<xs:complexType>
					<xs:simpleContent>
						<xs:restriction
base="typeTString">
							<xs:maxLength
value="100"/>
						</xs:restriction>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
</xs:schema>
Received on Sunday, 27 April 2003 21:35:33 GMT

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