Help with Xerces Schema validation

Hi all,

I'm trying to parse and validate document instances using latest Xerces
(2.0.0).

I have set to "true" the following attributes on the DOM parser :
"http://xml.org/sax/features/namespaces";
"http://xml.org/sax/features/validation";
"http://apache.org/xml/features/validation/schema";
"http://apache.org/xml/features/validation/schema-full-checking";

but I am not very sure about what it all does ...

Anyway, when set to true, some of my XPath expression are not evaluated
correctly and the parser fails in retrieving some node.

However, when I turn off some validation (like namespace), other problems
occur ...

When every validation is turned off, the parsing is ok, but nothing is
validated ...

Could somebody give me useful pointers as to understand what each of these
feature does, how do they interact with each other, maybe working examples.

My schema has a given namespace, and imports another schema that has another
namespace. In my instance document, I only state the "main" schemalocation
(if I state both schemalocation - redundancy - XML spy 4.3 complains ...).
Does this "hurt" (see snipet herebelow) ?


"main schema"
<xs:schema 
	targetNamespace="http://www.imtf.com/e-document"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns="http://www.imtf.com/e-document"
	xmlns:dcmi="http://www.imtf.com/e-document/dcmi"
	elementFormDefault="qualified">
	
	<xs:import namespace="http://www.imtf.com/e-document/dcmi"
schemaLocation="DCMI.xsd"/>


"imported schema"
<xs:schema 
	targetNamespace="http://www.imtf.com/e-document/dcmi" 
	xmlns="http://www.imtf.com/e-document/dcmi"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified">

"instance document"
<e-document
	xmlns="http://www.imtf.com/e-document"
	xmlns:dcmi="http://www.imtf.com/e-document/dcmi"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.imtf.com/e-document edoc.xsd"

Thanks in advance for your help,

Régis

Received on Wednesday, 27 February 2002 06:00:48 UTC