How to parse (non well-formed) HTML in android?

穿精又带淫゛_ 提交于 2019-12-11 13:48:42

问题


How to parse non well-formed HTML in android ?

I tried to use XOM and TagSoup, but i get the following error when creating the Builder:

11-26 20:42:39.294: ERROR/dalvikvm(1298): Could not find method org.apache.xerces.impl.Version.getVersion, referenced from method nu.xom.Builder.

Must i install Xerces to use XOM or can i use tagsoup without XOM ?


回答1:


You might find JTidy (http://jtidy.sourceforge.net/) - a port of HTMLTidy to be sufficiently lightweight. It outputs XHTML on request




回答2:


XOM may require Xerces to be in the classpath - it may depend on the version of Java. Currently we use

xercesImpl-2.8.0.jar


来源:https://stackoverflow.com/questions/1805869/how-to-parse-non-well-formed-html-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!