When I tried to parse a xml file with JDOM, I got the exception: Could not load default SAX parser: org.apache.xerces.parsers.SAXParser: SAX2 driver class org.apache.xerces.parsers.SAXParser not found: org.apache.xerces.parsers.SAXParser
The following is the code snippet: try { SAXBuilder builder = new SAXBuilder(true); Document doc = builder.build(getApplicationContext().getResources ().openRawResource(R.raw.ps_xml)); if (doc != null) { Element parameters = doc.getRootElement(); } resultSB.append(doc.toString()); } catch (Exception exp) { resultSB.append("Exception: " + exp.getMessage()); } I'm using android sdk-windows-1.5_r3, JDOM 1.1.1 and xerces parsers comes with JDOM. There are some warning messages when building the android project: ... [2009-09-08 11:23:16 - JDOMTest2] warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.) [2009-09-08 11:23:17 - JDOMTest2] trouble processing: [2009-09-08 11:23:17 - JDOMTest2] bad utf-8 byte a0 at offset 00000004 ...while parsing cst 00bf at offset 000008dd ...while parsing cst 003c at offset 00000109 ...while parsing org/apache/xerces/impl/xpath/regex/ ParserForXMLSchema.class ...while processing org/apache/xerces/impl/xpath/regex/ ParserForXMLSchema.class [2009-09-08 11:23:18 - JDOMTest2] trouble processing: [2009-09-08 11:23:18 - JDOMTest2] bad utf-8 byte 80 at offset 00000021 ...while parsing cst 0247 at offset 00001879 ...while parsing cst 0051 at offset 0000016e ...while parsing org/apache/xerces/impl/xpath/regex/Token.class ...while processing org/apache/xerces/impl/xpath/regex/Token.class [2009-09-08 11:23:18 - JDOMTest2] warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.) ... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---