Yes this is exactly what the EntityResolver is for.

Usage:
Override the EntityResolver class.
Implement the ResolveEntity method.
Return a InputSource for a known entity or return null to use the normal
Xeces behavour.
Create an instance of your EntityResolver and plug it into the parser with
the method setEntityResolver before you parse.

/ Erik


-----Original Message-----
From: Oliver, Steve [mailto:[EMAIL PROTECTED]]
Sent: den 16 januari 2003 19:48
To: Xerces Dev
Subject: Finding the schema


Hi all,

I have a question about how the DOM parses locates the schema file when it
validates a document. Here is a sample of a root element that I might
receive...

<OTA_CommNotifRQ xmlns="http://www.opentravel.org/OTA";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.opentravel.org/OTA OTA_CommNotifRQ.xsd">

Everything works just fine as long as my schema document is located in the
same directory as my executable. Problem is I don't want to have a bunch of
.xsd files in my bin directory. I  also don't want the client application
that is sending me these XML docs to have to know where I decided to keep my
schemas. Is this what the EntityResolver is for? If so, how does one use it?
If not, how do I solve this?

Thanks for the help...

Steve

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

<<attachment: winmail.dat>>

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

Reply via email to