开发者

Android: can not import org.apache.harmony.xml.ExpatReader

I need to parse an UTF-8 encoded input stream, so I think the most appropriate method is to use

    XMLReader reader = new ExpatReader();
    InputSource source = new InputSource(in);
    source.setEncoding(encoding.expatName);
    reader.parse(source);

For that I need to import org.apache.harmony.xml.ExpatReader but I cannot figure out how, I mean which Java package must I install from http://harmon开发者_StackOverflow社区y.apache.org/download.cgi?

Or is there an alternative method to accomplish the same goal?

Thank you for helping.


you don't instantiate an expat reader directly. just use the XMLReaderFactory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜