iPhone HTML Parsing using TouchXML and tidy

2019-04-17 09:14发布

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!

2条回答
Fickle 薄情
2楼-- · 2019-04-17 09:23

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.

查看更多
该账号已被封号
3楼-- · 2019-04-17 09:44

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 to HEADER_SEARCH_PATHS
查看更多
登录 后发表回答