Importing schemas

Hi

I have a schema common.xsd for common element types
used by my other schemas and I'm using the import
element in order to access those types.

I'm not sure about how to use the import element. I
validated (with XSV) an XML instance using a schema
that in turn uses the common.xsd schema and there were
no errors. 

However, when I include non-valid data in the XML
instance, XSV still says there are no errors. How can
I make sure my schemas are correct?

I attached the code of the documents I used at the end
of this message.


Many thanks,

David

<!-- common.xsd -->
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/1999/XMLSchema" 
   xmlns:cmn="someURL/common" 
   targetNamespace="someURL/common">

   <!-- Simple types -->
   <simpleType name="simpleTwoBitType" base="string">
      <pattern value="((O|I){2})"/>
   </simpleType>
   <simpleType name="simpleEnum0To4Type" base="byte">
      <minInclusive value="0"/>
      <maxInclusive value="4"/>
   </simpleType>
   ...

   <!-- Complex types -->
   <complexType name="floatType" base="float"
derivedBy="extension">
      <attribute name="ref" type="string"
use="optional"/>
   </complexType>
   <complexType name="booleanType" base="boolean"
derivedBy="extension">
      <attribute name="ref" type="string"
use="optional"/>
   </complexType>
   <complexType name="twoBitType"
base="cmn:simpleTwoBitType" derivedBy="extension">
      <attribute name="ref" type="string"
use="optional"/>
   </complexType>
   <complexType name="enum0To4Type"
base="cmn:simpleEnum0To4Type" derivedBy="extension">
      <attribute name="ref" type="string"
use="optional"/>
   </complexType>
   ...

</schema>


<!-- loop.xsd -->
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/1999/XMLSchema" 
   xmlns:loop="someURL/loop" 
   targetNamespace="someURL/loop" 
   xmlns:cmn="someURL/common">

   <import namespace="someURL/common"
schemaLocation="common.txt"/>

   <complexType name="loopType" content="elementOnly">
      <sequence maxOccurs="1">
         <element name="P" type="cmn:floatType"
minOccurs="0" maxOccurs="1"/>
         <element name="S" type="cmn:booleanType"
minOccurs="0" maxOccurs="1"/>
         <element name="F" type="cmn:enum0To4Type"
minOccurs="0" maxOccurs="1"/>
         <element name="K" type="cmn:twoBitType"
minOccurs="0" maxOccurs="1"/>
      </sequence>
      <attribute name="number" type="int"
use="optional"/>
   </complexType>
   <element name="loop" type="loop:loopType"/>
</schema>


<!-- loop.xml -->
<?xml version="1.0"?>
<loop
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
      xsi:noNamespaceSchemaLocation="loop.txt" 
      number="1">
   <P>22.5</P>
   <S ref="505,7">1</S>
   <F ref="32">4</F>
   <K ref="something">AA</K>
</loop>



_________________________________________________________
Do You Yahoo!?
Obtenga su dirección de correo-e gratis @yahoo.com
en http://correo.espanol.yahoo.com

Received on Thursday, 7 September 2000 09:46:38 UTC