问题
I'm trying to parse HTML using TouchXML. However, it seems that the data I want to parse (I do not control the source, it's downloaded from the internet) is partially malformed - I get various errors during the parse. Therefore, it seems that I should be using the inbuilt tidy support to fix the HTML but I cannot seem to find any documentation or information on how to enable it or link libtidy successfully into my project.
If anyone has any information on how to do this, it'd be much appreciated. Alternatively if there's another tool I could be using to do this - do tell me!
回答1:
Actually, you can both link to the framework and include the headers, without needing to download the source.
- Link to the existing framework
libtidy.dylib
- Add
/usr/include/tidy
toHEADER_SEARCH_PATHS
回答2:
Turns out that although the framework can be linked in to an xcode project, the headers are missing. I have got around this by downloading the HTML Tidy Source (src and include directory) and added them in to compile as part of my xcode project.
来源:https://stackoverflow.com/questions/4258333/iphone-html-parsing-using-touchxml-and-tidy