The only way this would work is if you provided HTTP access to the
"WEB-INF" directory, which is disallowed by App Servers by default
(thank goodness!). Since you are setting this programmatically, you
can do the following instead...
String urlStr = classloader.getResource("management.xsd").toExternalForm();
parser.setProperty(
"<http://apache.org/xml/properties/schema/external-schemaLocation>http://apache.org/xml/properties/schema/external-schemaLocation",
urlStr);
That should work properly no matter what kind of platform your
application is deployed upon.
Jake
At 11:46 AM 9/14/2006, you wrote:
Hi,
I am using Xerces-2.8. I have a problem to load the schema file to
validate the XML.
The validation worked when I was using an absolute path for the
schema location.
parser.setProperty(
"<http://apache.org/xml/properties/schema/external-schemaLocation>http://apache.org/xml/properties/schema/external-schemaLocation",
" http://test.com/web/management/request C:\management.xsd");
But the same code has to be ported on Linux/Unix servers, so I tried
to give path relative to context root, and placed the xsd file under
that path, but it doesn't seem to load the XSD file. For example I
tried to put
management.xsd under WEB-INF/classes and tried
parser.setProperty(
"<http://apache.org/xml/properties/schema/external-schemaLocation>http://apache.org/xml/properties/schema/external-schemaLocation",
" http://test.com/web/management/request
/WEB-INF/classes/management.xsd");
If I want to keep my XSD file under my context root in app server,
how should I specify the path in above property? Any help will be
appreciated. Thanks in advance,
Nilesh
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]