XmlPullParser read InputSource
-
07-07-2019 - |
Question
I know how to create InputSource
out of Reader
but how to do it the other way around?
I'm capturing org.xml.sax.InputSource
and now want to feed it into org.xmlpull.v1.XmlPullParser
. That one has few setInput methods but these only accept Reader
or InputStream
as an argument. What would be the best way to convert InputSource
into one of these?
Solution
Silly me
XmlPullParser xpp = factory.newPullParser();
xpp.setInput(is.getCharacterStream());
Where "is" is InputSource
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow