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>

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:element name="Organisation"
type="Organisation" />

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

	<xs:complexType name="typeOrganisation" mixed="true">
			<xs:element name="OrganisationName" minOccurs="0">
Received on Sunday, 27 April 2003 21:35:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:10 UTC