W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: Validating xml file with schema using xerces-j

From: Rahul Srivastava <Rahul.Srivastava@Sun.COM>
Date: Thu, 11 Oct 2001 11:09:35 +0000 (Asia/Calcutta)
Message-Id: <200110110541.f9B5fPH15276@blr-root.India.Sun.COM>
To: xmlschema-dev@w3.org
> Nguyen, Thang wrote...
> 
> Hi, 
> I'm currently trying to figure out how to make my program validate
> an xml file againt a schema file using xerces-j

First question is which version of xerces-j are you using?. If you are using 
xerces2, then, hold it!. Xerces2 does not support schema support, as of now.

If you are using xerces1 (1.4.x), then you can either instantiate parser as 
SAXParser or DOMParser. Set the feature on to support validation and invoke 
parser.parse(). This will validate your xml file against schema.

> 
> I can't seem to find which class to instantiate to include the schema file
> (xsd)

This question is not very clear to me.
The xml instance file points to the schema file against which validation is to 
be performed. So, the schema file is picked from the location, pointed out by 
xml instance and carries on with the validation process.

Why do you need to instantiate a class to include schema.

-Rahul.

> 
> thanks for any help,
> 
> 
Received on Thursday, 11 October 2001 01:41:31 GMT

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