Inga,

Have you tried to include both a DTD and Schema
declaration in the same xml source document ?
Xerces generates a ClassCastException.

Something like: 

<!DOCTYPE root-element SYSTEM 'root-element.dtd'>
<root-element xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="your schema address">

Stefan Lecho.

-----Original Message-----
From: Inga Schuetz [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 26, 2001 9:19 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: XML Schema Validation


Hello Sam,

your XML-Dokument has to look like this

<root-element xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="your schema address">

Your schema starts with

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema";>

Now you have to set some properties for your Xerces Parser. It is importent
that validation, schema support und namspaces is set to true.

((XMLReader)parser).setFeature("http://xml.org/sax/features/validation";,
true);
((XMLReader)parser).setFeature("http://apache.org/xml/features/validation/sc
hema", true);
((XMLReader)parser).setFeature("http://xml.org/sax/features/namespaces";,
true);

I hope this will help

Inga


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to