I think you can provide a hint to the parser to the location of the schema file.
You should be able to do something like.
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(true);
dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLocation",
"http://www.example.com/Report.xsd");
Actually i picked the above from this site here.
http://java.sun.com/xml/jaxp/change-requests-12.html
You might want to read through it and see if it would work for you.
Hope that helps.
Dhayanithi.
na******@informatica.com (Naresh Agarwal) wrote in message news:<2b**************************@posting.google. com>...
Hi
I'm using SAX Parser of Xerces Java v2.4.0 for XML Parsing.
I want to perform schema validations on the xml.
The problem is that root element of XML document does not have
"xsi:schemaLocation" attribute, which is used to specify the .xsd
file.
Is there any other way for specifying the name of .xsd file?
thanks,
Naresh