W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2003

RE: loading xsd schema seperately for validating the xml Document

From: Rahul Srivastava <rsrivastava@firstam.com>
Date: Thu, 3 Apr 2003 17:06:51 +0530
To: xmlschema-dev@w3.org
Message-ID: <DCEOINHBBGNKKGDNCMDNEECKCCAA.rsrivastava@firstam.com>

Hi Nitin,

 > Nitin Malhotra wrote...
 > 
 > 
 > Hello All.
 > 
 > The problem : I am trying to validate a xml document which has 
 > inbuilt reference to its xsd schema.
 > but the problem is that the xsd if somewhere on the classpath 
 > and its exact uri is unknown. so the parser
 > is not able to load this xsd file. Meaning this xsd is packed 
 > somewhere in a ear file. 
 > 
 > question : is it possible to load xsd seperately and then ask 
 > DOMParser to use this xsd to validate a certain xml doc. In 
 > context to Java APIs.

Yes, you can load the XMLSchema file externally, using external-schemalocation property (look for the exact property name), if you are using JAXP or Xerces. But, you need to know the exact location of the XMLSchema file. If the schema is in some jar, which is in the classpath, you can try using - 
jar:/file:///home/..../abc.jar!/myschemas/myschema.xsd

Hope that helps.

Cheers,
Rahul.

 > 
 > Thanks for any help,
 > nitin.
 > 
 > 
 > 
 > 
Received on Thursday, 3 April 2003 06:26:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT