W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

Help with Xerces Schema validation

From: Piccand Régis <regis.piccand@imtf.ch>
Date: Wed, 27 Feb 2002 11:53:26 +0100
Message-ID: <DF7EC83D7AFBD411965B0008C7596EC53ED5BE@imtfexchange.imtf.ch>
To: Schema XML <xmlschema-dev@w3.org>
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 GMT

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