At 17.25 06/03/01 -0500, you wrote:
Hi Keith,

Thanks for your reply. Even i thought in the way you thought. So i configured my webserver and i gave the XSD path as <http://localhost/cv_enterprise.xml>http://localhost/cv_enterprise.xml. (My localhost was pointing to the directory where the XSD is. I checked it with browser and i'm able to open the XSD file thru browser giving the above url). But even then the parser is not validating the xml document. Do u think is there any other reason??

Ragunath

I merged your code in the doGet method, after executing the servlet I have this message from the browser


IXX EXISTS is EXISTS its working

does it means the .XML is valid against the schema ???


/**Process the HTTP Get request*/
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try{
PrintWriter out = response.getWriter();
DOMParser pt = new DOMParser();
String sxx = new String("C://jboss_tomcat/tomcat-3.2-b7/webapps/xslt/WEB-INF/cv_enterprise.xml");
FileInputStream ixx = null;
try{
ixx = new FileInputStream(sxx);
}
catch(Exception e){ System.out.println("error is "+ e.getMessage()); }
out.println("<html><body>");
if (ixx != null) {out.println("IXX EXISTS"); } else { out.println("IXX NON EXISTS"); }
InputSource is = new InputSource(ixx);
if (is != null) { out.println("is EXISTS"); } else { out.println("is NON EXISTS"); }
pt.setFeature("http://xml.org/sax/features/validation";, true);
pt.setFeature("http://apache.org/xml/features/validation/schema";, true);
// pt.setValidation(true);
// pt.setValidationSchema(true);
try{
pt.parse(is);
}
catch (Exception e) {
System.out.println("NonParserException: " + e.getMessage());
out.println("QUALCOSA NON VA");
}
out.println("its working");
out.println("</body></html>");
}catch(Exception e){}
}



Thks, Leonardo


============================================== Lulli Informatica S.r.l. http://www.lulliinformatica.com ---------------------------------------------- Leonardo Battagli: Java/XML Developer at [EMAIL PROTECTED] ============================================== Out of the office email address: [EMAIL PROTECTED] ==============================================



Reply via email to