I am having problem parsing my xml against the schema, could you please help me?????????????? The problem is that If I change the the data types in from int (specified in .xsd) to a string like (abc)in the .xml file, I don't get an exception from the parser. I am attaching the .xml , .xsd file and .xsl file here I will add my java code here too. Thaks! Zahra (See attached file: hphood_payroll.xml)(See attached file: payroll.xsl)(See attached file: payroll.txt)(See attached file: payroll.xsd) private static void parseXml() { try { String filename = "C:\\FirsTeam\\Internet\\xml\\hphood_payroll.xml"; String outFileName = "C:\\FirsTeam\\Internet\\xml\\hphood_payroll.new.xml"; InputStream in = new FileInputStream(filename); Writer writer = new FileWriter(outFileName); org.apache.xerces.parsers.DOMParser parser = new org.apache.xerces.parsers.DOMParser(); parser.parse(new org.xml.sax.InputSource(in)); Document xmlDoc = parser.getDocument(); XmlUtil.printXmlNode(xmlDoc, System.out); } //catch(Exception e) { // e.printStackTrace(System.out); //} catch(IOException e) { System.out.println("Error in reading File: " + e.getMessage()); } catch(SAXException e) { System.out.println("Error in parsing: " + e.getMessage()); } catch(DOMException e) { System.out.println("Error in parsing: " + e.getMessage()); } } here is the java code
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:30 GMT