JAXP on Android?
I have a jar-library processing xml. It runs perfectly when using it with a desktop application. But using it within an Android App, it throws the following exception:
org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
I could find out that it's throwing the above exception in the setProperty method.
public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser saxParser = spf.newSAXParser();
saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
When开发者_开发知识库 Debugging the desktop app, I figured out that 'spf' is of type com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
and on Android type of org.apache.harmony.xml.parsers.SAXParserFactoryImpl
Is there any solution to use JAXP_SCHEMA_LANGUAGE on Android?
精彩评论