Using TouchXML with HTML Tidy

2019-08-19 12:55发布

问题:

I am trying to set up TouchXML in my iPhone app to parse HTML from a website, but unfortunately the website's HTML isn't valid XML. I'd like to use HTML tidy to tidy it up, and in fact TouchXML has a setting, TOUCHXMLUSETIDY, which when turned on in fact does this. But when I turn on this setting, I get the following errors: Tidy.h: No such file or directory found. I have libtidy.dylib installed in my target, and tried downloading the HTML Tidy source and putting it directly into my app, but nothing is working. Any suggestions for how to tidy up HTML into valid XML on the iPhone?

回答1:

Tidy.h is found in /usr/include/tidy add that to your User Header Search Paths in xcode as well as add -ltidy to your Other Linker Flags. You should be all set.



回答2:

Did you download the TouchXML? Then you should add the files in /TouchXML/Externals/tidy/src to your project. That's the tidy!