Hello!

I have corrected my target namespace errors in my diffents xsd files.
Now when I try to validate my XML file, I got errors like:
schema_reference.4: Failed to read schema document 'RIRName.xsd',
because 1) could not find the document; 2) the document could not be
read; 3) the root element of the document is not <xsd:schema>. 

If I use an EntityResolver, this error will not occur again. What I did:

        public InputSource resolveEntity(String publicId, String
systemId) throws SAXException, IOException {
                if (systemId.endsWith("Order_L_0_96.xsd")) {
                        return new
InputSource(System.getProperty("schemaLocation").concat(File.separator).
concat("Order_L_0_96.xsd"));
                } else if (systemId.endsWith("WISkeletons.xsd")) {
                        return new
InputSource(System.getProperty("schemaLocation").concat(File.separator).
concat("WISkeletons.xsd"));
                }
                return null;
        }

Now I would prefer to avoid to hard-code such an information. Is the
catalog a good solution?

Lydie.
-----Original Message-----
From: Prashant [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 21, 2006 16:50
To: [email protected]
Subject: Re: Trying to validate XML files using several XSD

Are you talking about OASIS Catalog ? 
http://www.oasis-open.org/committees/entity/

I think Catalog is just a standardized way of writing an EntityResolver.

OASIS needs you to produce a standard XML that maps the public Ids to
local URIs. By using this method you simply would use library supplied
implementation of EntityResolve like OASISEntityResolver that
understands the Catalog XML.

Because Catalog is a standardized way, it will come in handy if you were
to use tools like <xslt> task of ANT.

Hope this helps.

-Prashant


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

Reply via email to