Support for my Android 2.2 application on Android 2.1

I developed the application in Android 2.2, and my clients want me to support it on 2.1 Therefore, I have a dependency on XML parsing because I use the following code:

XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
//Set xmlns namespace otherwise xmlns will not be parsed
xpath.setNamespaceContext(new PersonalNamespaceContext());

//Parse XML string
XPathExpression expr = xpath.compile(CCRKEY1);          
Object result = expr.evaluate(doc, XPathConstants.NODESET); 

Now in 2.1 I can not get access to XPathFactory, XPath, XPathExpression So, what can be similar techniques to replace them in 2.1 ??

Thank,

+3
source share
1 answer

XPath 2.1, , SAX DOM XPath, jaxen. JAXP, XPath, Java > 5.

Build.VERSION, , .

+2

Source: https://habr.com/ru/post/1779151/


All Articles