W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2003

RE: Importing XMLSchema.xsd

From: <Simon.Cox@csiro.au>
Date: Tue, 11 Nov 2003 10:01:07 +0800
Message-ID: <2A2B2F12CF99EA4A898E2D4729441B413AA2D3@exwa2-per.wa.csiro.au>
To: <jddahl@micron.com>, <xmlschema-dev@w3.org>

I'd like to back up Jeff's question.  

I tried this a few months ago and XML Spy also rejected it - it appears that (quite reasonably) the tools have their own "private" version of the S4S loaded, but this then causes a clash (multiple declarations of the same component), which results in the import of the S4S to fail and the components to *not* be available.   

This is kinda frustrating.  There should really be no reason that the S4S is treated any different to any other schema import.  Surely this is why we choose to "eat our own dogfood".  Similar to Jeff I want to be able to use the simpleType definitions to describe constraints on values within an instance document.  I could subset the S4S and put it in a new namespace, but why should this be necessary.  

Simon Cox

> -----Original Message-----
> From: jddahl@micron.com [mailto:jddahl@micron.com]
> Sent: Wednesday, 5 November 2003 11:22 PM
> To: xmlschema-dev@w3.org
> Subject: Importing XMLSchema.xsd
> 
> 
> 
> I am trying to import the XMLSchema itself to allow users to 
> identify their own data types.
> 
> ----------------------------------------------------------
> db.xsd
> <?xml version="1.0" encoding="US-ASCII"?>
> 
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>             targetNamespace="http://testeng.micron.com/data"
>             xmlns="http://testeng.micron.com/data"
>             elementFormDefault="qualified">
>   
>   <xsd:import namespace="http://www.w3.org/2001/XMLSchema" 
> schemaLocation="http://www.w3.org/2001/XMLSchema.xsd"/>
> 
>   <xsd:element name="model">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:any namespace="http://www.w3.org/2001/XMLSchema" 
> minOccurs="0" maxOccurs="unbounded" processContents="strict"/>
>       </xsd:sequence>
>       <xsd:attribute name="name" type="xsd:NCName"/>
>     </xsd:complexType>
>   </xsd:element>
>   
> </xsd:schema>
> 
> ----------------------------------------------------------
> model.xml
> <?xml version="1.0" encoding="US-ASCII" standalone="no"?>
> 
> <model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>        xsi:schemaLocation="http://testeng.micron.com/data db.xsd" 
>        xmlns="http://testeng.micron.com/data" 
>        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>     
>   <xsd:simpleType name="my_type">
>     <xsd:restriction base="xsd:string">
>       <xsd:enumeration value="string1"/>
>       <xsd:enumeration value="string2"/>
>       <xsd:enumeration value="string3"/>
>     </xsd:restriction>
>   </xsd:simpleType>
> 
> </model>
> 
> ----------------------------------------------------------
> 
> Yet, when I run Xerces, I get the following error:
> 
> java -classpath 
> /home/jddahl/xerces-2_5_0/xercesSamples.jar:/home/jddahl/xerce
> s-2_5_0/xercesImpl.jar sax.Counter -v -s -f -n -np model.xml
> [Error] model.xml:8:42: cvc-complex-type.2.4.c: The matching 
> wildcard is strict, but no declaration can be found for 
> element 'xsd:simpleType'.
> 
> Is this a Xerces bug, or am I doing something wrong?
> 
> Thanks,
> Jeff Dahl
> 
Received on Monday, 10 November 2003 21:01:17 UTC

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