RE: Importing XMLSchema.xsd

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