Hi Shobha,
By default, the validation is turned off in most parsers. So when you use the parser, you need to explicitly turn on the validation.
If you are using SAX2Count (Part of xerces distribution which you can download from the
Apache web site ) to parse the XML file, then you can turn the validation on by specifying a command line like
java sax.SAX2Count -v myxml.xml
In case you have your own program to read an XML document, then try
// Initialize XMLReader
myReader.setFeature("http://xml.org/sax/features/validation",true);
In your case, you appear to be using a validating parser, but have not turned the validation on. So it is currently only checking for well formedness.
Hope this helps . . .
Shashank
<b><br /><a href="http://mailto:tanksali@hotmail.com" target="_blank" rel="nofollow">Shashank Tanksali</a><br /><i><br />SCJP2,SCJD2,SCWCD<br />IBM Certified Developer - XML and Related Technologies<br />PMI Certified Project Management Professional<br /></i><br /></b>