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

RE: Derivation by Restriction and Namespaces - SQC Bug?

From: Jeff Lowery <jlowery@scenicsoft.com>
Date: Wed, 2 Jan 2002 16:59:27 -0800
Message-ID: <3549BAFD79A7D411A1CF00508B62B5BC0124B991@exchange-us.scenicsoft.com>
To: "'Martin Bernauer'" <bernauer@dke.uni-linz.ac.at>, xmlschema-dev@w3.org
Shouldn't get any error. 

When I run the example through SQC (version 1.2.004), I don't get the error
you're seeing. Are you running a newer or older version?

> -----Original Message-----
> From: Martin Bernauer [mailto:bernauer@dke.uni-linz.ac.at]
> Sent: Wednesday, January 02, 2002 6:27 AM
> To: xmlschema-dev@w3.org
> Subject: Derivation by Restriction and Namespaces - SQC Bug?
> 
> 
> I have troubles concerning derivation by restriction 
> concerning namespaces. When
> I derive a new type by restriction and want to put it in 
> another namespace than
> the one of its base type, SQC from alphaworks [1] detects an error.
> 
> To illustrate this consider the following example, depicting 
> two schemas. Schema
> test1a.xsd defines a "BasicEntry" Type and a "BasicList" 
> Type, the contents
> model of the latter type comprises "entry" elements of type 
> BasicEntry.
> 
> ----------[begin schema test1a.xsd ]----------
> <xs:schema targetNamespace="http://test1a" 
> xmlns:t1a="http://test1a" ...>
>   <xs:complexType name="BasicEntry">
>     <xs:sequence>
>       <xs:any/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:complexType name="BasicList">
>     <xs:sequence>
>       <xs:element name="entry" type="t1a:BasicEntry"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> ----------[end schema test1a.xsd ]----------
> 
> A second schema, test1b.xsd, derives a new type "RestrictedEntry" from
> BasicEntry by restriction and a new type "RestrictedList" 
> from BasicList. Notice
> that the namespace of RestrictedList is http://test1b, while 
> the namespace of
> BasicList is http://test1a.
> 
> ----------[begin schema test1b.xsd ]----------
> <xs:schema targetNamespace="http://test1b" xmlns:t1a="http://test1a"
> xmlns:t1b="http://test1b" ...>
>   <xs:import namespace="http://test1a" schemaLocation="test1a.xsd"/>
>   <xs:complexType name="RestrictedEntry">
>     <xs:complexContent>
>       <xs:restriction base="t1a:BasicEntry">
>         <xs:sequence>
>           <xs:element name="restrictingElement" type="xs:string"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="RestrictedList">
>     <xs:complexContent>
>       <xs:restriction base="t1a:BasicList">
>         <xs:sequence>
>           <xs:element name="entry" type="t1b:RestrictedEntry"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
> </xs:schema>
> ----------[end schema test1b.xsd ]----------
> 
> When validating test1b.xsd, SQC throws an error reporting 
> that the contents
> model of RestrictedList is not a restriction of BasicList.
> 
> However, when having all (four) complex type definitions in 
> the same namespace,
> SQC accepts the schemas. Since the restrictions themselves 
> seem to be valid
> irrespective of the namespaces this seems to be a bug of SQC 
> for me. Or is the
> restriction by itself invalid? Any comments on this?
> 
> Btw XSV (version 2001/11/29) validates test1b.xsd without 
> reporting any
> problems.
> 
> Regards, Martin
> 
> [1] http://www.alphaworks.ibm.com/tech/xmlsqc
> 
> ps: I wasn't able to post this to the SQC discussion forum, 
> sorry for any
> inconvienience my posting here may cause, nevertheless it's 
> also an XML Schema
> specific question.
> 
Received on Wednesday, 2 January 2002 20:00:44 GMT

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