W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2000

XSV handling of restriction of anyType

From: Priscilla Walmsley <priscilla.walmsley@xmls.com>
Date: Fri, 29 Sep 2000 10:25:33 -0400
To: "'Henry S. Thompson'" <ht@cogsci.ed.ac.uk>
Cc: <xmlschema-dev@w3.org>
Message-ID: <003101c02a21$26103e60$838f143f@priscillaw01>
I'm trying to validate an instance against a schema which restricts
"anyType".  The schema validates fine, but when I try to validate the
instance against the schema, it cannot find the anyType type.  The error
message I get is:

Error: Undefined type {http://www.w3.org/2000/10/XMLSchema}:anyType
referenced as basetype of [anonymous]

Am I doing something wrong with the namespaces?

Thanks,
Priscilla
--------------
The schema is:

<schema targetNamespace="http://www.example.com/Report"
        xmlns="http://www.w3.org/2000/10/XMLSchema"
       xmlns:r="http://www.example.com/Report"
        elementFormDefault="qualified">

 <element name="regions" type="r:RegionsType"/>
 <complexType name="RegionsType">
  <sequence>
   <element name="zip" maxOccurs="unbounded">
    <complexType>
     <sequence>
      <element name="part">
       <complexType>
        <complexContent>
         <restriction base="anyType">
          <attribute name="number" type="positiveInteger"/>
          <attribute name="quantity" type="positiveInteger"/>
         </restriction>
        </complexContent>
       </complexType>
      </element>
     </sequence>
    </complexType>
   </element>
  </sequence>
 </complexType>

</schema>


And the instance is:

<regions
  xmlns="http://www.example.com/Report">
  <zip>
   <part number="872" quantity="1"/>
   <part number="926" quantity="1"/>
   <part number="833" quantity="1"/>
   <part number="455" quantity="1"/>
  </zip>
  <zip>
   <part number="455" quantity="4"/>
  </zip>
 </regions>
Received on Friday, 29 September 2000 10:24:11 GMT

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