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

RE: Two consecutive derivations by restriction

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Mon, 15 Jul 2002 14:08:40 -0400
To: "'Rainer Becker'" <r.becker@Nitro-Software.com>, <xmlschema-dev@w3.org>
Message-ID: <002201c22c2a$a6e72550$339afea9@WALMSLEYPH>
Hello Rainer,
There is nothing in Structures that prevents you from performing
consecutive derivations.  The problem with your example is that the
Street element is required in the ListType (and in FirmaType), so you
have to include it in the content model for OperatorType.  Otherwise,
instances of OperatorType would never also be valid for FirmaType, which
is a requirement when deriving by restriction.  You can either change
OperatorType to include Street, or make Street optional in both ListType
and FirmaType.  
Hope that helps!
Priscilla Walmsley             priscilla@walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)

-----Original Message-----
From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org]
On Behalf Of Rainer Becker
Sent: Friday, July 12, 2002 4:56 AM
To: 'xmlschema-dev@w3.org'
Subject: Two consecutive derivations by restriction

I hope, that this has not been answered before, but I couldnīt find a
hint in this list.
My questions are:
First question:
Is it possible, to perform two or more consecutive derivations by
Given the following schema:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:element name="Liste">
            <xsd:element name="Firma" type="FirmaType" />
            <xsd:element name="Operator" type="OperatorType" />     
   <xsd:complexType name="ListType">
         <xsd:element name="Name" type="xsd:string" />
         <xsd:element name="Comment" type="xsd:string" minOccurs="0"
         <xsd:element name="Street" type="xsd:string" />
   <xsd:complexType name="FirmaType">
        <xsd:restriction base="ListType">
              <xsd:element name="Name" type="xsd:string" />
              <xsd:element name="Comment" type="xsd:string"
minOccurs="0" maxOccurs="2" /> 
              <xsd:element name="Street" type="xsd:string" />
   <xsd:complexType name="OperatorType">
         <xsd:restriction base="FirmaType">
               <xsd:element name="Name" type="xsd:string" />
Although I am not 100% sure I donīt think it is, because this schema
produces an
"invalid particle derivation by restriction". I can not find any other
mistake in it.
If my assumption is correct I would also be interested to know, why this
is forbidden?
Second question: I tried to find some kind of confirmation in the
"Structures" for this problem.
If one was able to give me a pointer in Structures, I would be very
Rainer Becker
Received on Monday, 15 July 2002 14:10:10 UTC

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