Hi
rajagopal just one doubt if you are using java 1.4 then how to move on and moreover I am not validating multiple xml but a single xml using xerces I am attaching the code also actually the xsd is pretty large like 1.2 mb I believe this is the reason for it. If you have any suggestion it will be of great help
thanx
code:
import org.apache.xerces.parsers.SAXParser;
import java.io.File;
import org.w3c.dom.Document;
import java.util.*;
public class ValidateWithSchema {
public static void main (
String args[])
{
File docFile = new File("ReadyForms_111505_Ca_9997.xml");
try
{
//Calendar c = new Calendar();
//long l =c.time;
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
System.out.println(cal.getTime());
SAXParser parser = new SAXParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
"D:/xslt/xml_xslt/transform/ReadyForms_111505.xsd");
ErrorChecker errors = new ErrorChecker();
parser.setErrorHandler(errors);
parser.parse("D:/xslt/xml_xslt/ca form mapping/ReadyForms_111505_Ca_9914.xml");
//long l1 = c.time;
Calendar cal1 = Calendar.getInstance(TimeZone.getDefault());
System.out.println(cal1.getTime());
}
catch (Exception e)
{
System.out.print("Problem parsing the file.");
}
}
}