开发者

Parsing HTML in Android: no XSLT? What to use?

In need in my application to fetch remote HTML document and parse some parts out of it. As I don't want to play with string pa开发者_高级运维rsing, which would be really lots of work, I thought about using XSLT, which would let me build small XML document out of HTML and then read it easy.

Seems there is no XSLT support in Android? What other ways I could parse HTML without parsing content as simple string directly?


I thought about using XSLT, which would let me build small XML document out of HTML and then read it easy.

Unlikely. Most HTML is not valid XML.

What other ways I could parse HTML without parsing content as simple string directly?

To parse HTML, you use an HTML parser. There are several open source ones, and it is reasonably likely that one or more will work on Android with few modifications if any.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜