You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jacob Kjome <ho...@visi.com> on 2006/12/03 17:39:43 UTC
Re: issue loading schema for XML validation
URLmanagementSchemaURL = getClass().getResource("/management.xsd");
parser.setProperty(
"<http://apache.org/xml/properties/schema/external-schemaLocation>http://apache.org/xml/properties/schema/external-schemaLocation",
managementSchemaURL.toExternalForm());
Jake
At 10: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: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org