- From: <MarkH@i2.co.uk>
- Date: Mon, 8 Jan 2001 12:06:04 -0000
- To: xmlschema-dev@w3.org
I'm trying to use <import> to add to an existing schema in the same
namespace and am getting an error from XSV that I don't understand. I've
included cut down test files and the error report and would be grateful if
someone would point out my stupidity! (XML Spy concurs with the error so I
know it's my brain that is the problem). If I naively stick "vlvx" in the
target namespace I get more errors which I don't understand, so if that
should be the solution, expect another post soon!).
Command line:
Thanks
Mark
=== imported-schema.xsd ===
<?xml version="1.0"?>
<schema
targetNamespace="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
xmlns:vlvx="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<complexType name="topType">
<sequence>
<element name="property">
<complexType>
<attribute name="name" type="CDATA"
use="required"/>
<attribute name="value" type="CDATA"
use="required"/>
</complexType>
</element>
</sequence>
<attribute name="format" type="CDATA" use="required"/>
</complexType>
</schema>
=== types-schema.xsd ===
<?xml version="1.0"?>
<schema
targetNamespace="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
xmlns:vlvx="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<import namespace="vlvx" schemaLocation="imported-schema.xsd">
<annotation>
<documentation>
imported-schema.xsd defines a top level complexType 'topType'
</documentation>
</annotation>
</import>
<element name="newdoc">
<complexType>
<sequence>
<element name="thing1"
type="vlvx:derivedFromTopType">
<annotation>
<documentation>
???
</documentation>
</annotation>
</element>
<element name="thing2" type="vlvx:topType">
<annotation>
<documentation>
???
</documentation>
</annotation>
</element>
</sequence>
</complexType>
</element>
<complexType name="derivedFromTopType">
<annotation>
<documentation>???</documentation>
</annotation>
<complexContent>
<extension base="vlvx:topType">
<sequence/>
</extension>
</complexContent>
</complexType>
</schema>
=== types-test-instance.xml ===
<?xml version="1.0" encoding="UTF-8"?>
<vlvx:newdoc
xmlns:vlvx="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:schemaLocation="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema
types-test.xsd">
<thing1 format="abc">
<property name="p1" value="qqq"/>
</thing1>
<thing2 format="def">
<property name="p2" value="rrr"/>
</thing2>
</vlvx:newdoc>
=== Result of running XSV on types-test-instance.xml ===
Schema validating with XSV 1.173/1.80 of 2000/10/18 15:54:58
* Target: file:/E:/My Documents/_ Work
Current/_VLV/XML/types-test-instance.xml
()
* docElt: {http://www.i2group.com/Schemas/2001-01-01/VLVXSchema}newdoc
* Validation was strict, starting with type [Anonymous]
* schemaLocs: http://www.i2group.com/Schemas/2001-01-01/VLVXSchema ->
types-test.xsd
* The schema(s) used for schema-validation had no errors
* instanceAssessed: true
* No schema-validity problems were found in the target
Low-level XML well-formedness and/or validity processing output
Warning: Document has no DTD, validating abandoned
(detected at end of prolog of document file:/E:/My Documents/_ Work
Current/_VLV/XML/types-test.xsd)
Warning: Document has no DTD, validating abandoned
(detected at end of prolog of document file:/E:/My Documents/_ Work
Current/_VLV/XML/imported-schema.xsd)
Schema resources involved
Attempt to import a schema document from file:/E:/My Documents/_ Work
Current/_VLV/XML/types-test.xsd for
http://www.i2group.com/Schemas/2001-01-01/VLVXSchema succeeded
Attempt to import a schema document from file:/E:/My Documents/_ Work
Current/_VLV/XML/imported-schema.xsd for vlvx succeeded
Schema representation errors
Detected during schema construction
file:/E:/My Documents/_ Work Current/_VLV/XML/imported-schema.xsd:2:191:
Error: targetNamespace mismatch: vlvx expected,
http://www.i2group.com/Schemas/2001-01-01/VLVXSchema found
Received on Monday, 8 January 2001 07:13:07 UTC