- From: Martin Bernauer <bernauer@dke.uni-linz.ac.at>
- Date: Thu, 3 Jan 2002 10:40:46 +0100
- To: <xmlschema-dev@w3.org>
- Cc: "Jeff Lowery" <jlowery@scenicsoft.com>
I use the latest version of SQC, 1.2.1.003. I have enclosed the reported error message below. martin ------------------------------------------------------------------------ F:\test>sqc test1b.xsd Initializing Schema Quality Checker. Please wait ... SchemaQualityChecker has been initialized PROCESSING test1b.xsd time : 2002-01-03T10:36:25 ... test1b.xsd (file 1 of 1) now being read ... ERROR file = file:F:/test/test1b.xsd line 21 column 19 SEVERITY: 1 ERROR TYPE: 2 MESSAGE TYPE REFINEMENT ERROR (content type incompatible with the content type of the basetype): In the definition of complexType http://test1b:RestrictedList, elementOnly content model (<xs:sequence maxOccurs="1" minOccurs="1"> <xs:element maxOccurs="1" minOccurs="1" name="entry" type="t1b:RestrictedEntry" xmlns:t1b="http://test1b"/> </xs:sequence> ) is not a restriction of elementOnly content model (<xs:sequence maxOccurs="1" minOccurs="1"> <xs:element maxOccurs="1" minOccurs="1" name="entry" type="t1a:BasicEntry" xmlns:t1a="http://test1a"/> </xs:sequence> ), the content type defined by the basetype. ------------------------------------------------------------------------ ----- Original Message ----- From: "Jeff Lowery" <jlowery@scenicsoft.com> > 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 Thursday, 3 January 2002 04:39:06 UTC