W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2004

inheritance problem (newbie)

From: Jan Limpens <jan.limpens@gmail.com>
Date: Thu, 16 Sep 2004 22:47:08 -0300
Message-ID: <51003a64040916184739ec6e57@mail.gmail.com>
To: xmlschema-dev@w3.org

hi people,

I have got this base xsd

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://limpens.com/blogbase"
xmlns="http://limpens.com/blogbase" elementFormDefault="qualified">
	<xs:element name="BlogInfo">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="BlogTitle" type="xs:string"/>
				<xs:element name="BlogDescription" type="xs:string"/>
				<xs:element ref="Entry" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="lang" type="xs:language"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="Entry">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Title"/>
				<xs:element name="Body">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Para" maxOccurs="unbounded"/>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="lang" type="xs:language"/>
			<xs:attribute name="pubdate" type="xs:dateTime"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="Blog">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="BlogInfo"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

and I want to derive from it in this schema

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://limpens.com/blog/illustrationblog"
xmlns="http://limpens.com" elementFormDefault="qualified"
xmlns:bb="http://limpens.com/blogbase">
	<xs:complexType name="ImageEntry" base="bb:Entry" derivedBy="extension">
		<xs:sequence>
			<xs:element name="SlideShow">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Image" maxOccurs="unbounded">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="ImageTitle"/>
									<xs:element name="ImageDescription"/>
									<xs:element name="ImageUrl"/>
								</xs:sequence>
							</xs:complexType>
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
</xs:schema>

but validation (stylus studio, I actually don't know which engine is
used here) tells me
Attribute 'base' cannot appear in global complexType declarations
Attribute 'derivedBy' cannot appear in global complexType declarations

while this is plain English I kind of understand, I unfortunately
don't know what to do now. I already stole the idea from
http://www.xmlpatterns.com/ExtensibleContentModelMain.shtml, but as it
seems this is not working...

thanks for the help!

-- 
Jan
http://www.limpens.com
Received on Friday, 17 September 2004 10:47:28 UTC

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