As I stated in the section that you just read, not surprisingly the Tidy library comes equipped with a neat group of functions whose primary capacity is to return to calling code all the errors raised when parsing a specified (X)HTML string. Let me show you the first function that belongs to this specific group. It's called "tidy_get:error_buffer()," and it allows you to easily retrieve, from Tidy's error buffer, all the warnings raised when interpreting a concrete (X)HTML string. The corresponding code sample is as follows: // example on using the ' tidy_get_error_buffer()' function /* displays the following: As illustrated above, the "tidy_get_error_buffer()" function displays all the errors that occurred while parsing a concrete (X)HTML string. In this case, I coded some badly-formatted (X)HTML data, and then used the function to show the pertinent warnings thrown by "tidy_parse_string()." Not too complex, right? However, as I said earlier, the Tidy library comes with a remarkable set of functions for retrieving all of the potential errors triggered when parsing some (X)HTML data. Therefore, in the following section I'm going to teach you how to use these additional error-handling functions. Click on the link that appears below and keep reading.
blog comments powered by Disqus |