PHP
  Home arrow PHP arrow Tracking Parsing Errors with the Tidy ...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Tracking Parsing Errors with the Tidy Library in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-07-11

    Table of Contents:
  • Tracking Parsing Errors with the Tidy Library in PHP 5
  • Summarizing some Tidy library concepts
  • Using the tidy_get_error_buffer() function
  • Using the tidy_access_count(), tidy_error_count() and tidy_warning_count() functions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Tracking Parsing Errors with the Tidy Library in PHP 5


    (Page 1 of 4 )

    Creating well-formed (X)HTML documents can be a hard-to-accomplish task, particularly for PHP developers who need to focus mainly on the data and business layers of their web applications, and not on their visual presentation modules. However, this issue can be addressed with minor hassles with the assistance of the excellent Tidy extension.

    Introduction

    Welcome to the last tutorial of the series "Working with the Tidy library in PHP 5." As you might have guessed, this series offers a friendly guide to using the most important functions that come bundled with the Tidy library, so you can start quickly incorporating them into your own PHP applications.

    Going straight to subject of this series, you'll remember that in the preceding article I showed you how to dissect and extract different parts of a given (X)HTML string (or even an (X)HTML file) for further processing. More concretely speaking, I demonstrated how to use the straightforward "tidy_get_html()," "tidy_get_head()" and "tidy_get_body()" functions, obviously included with the Tidy extension, in order to retrieve the entire content of a specific (X)HTML string, in addition to extracting its <head> and <body> sections respectively.

    While it must be admitted that retrieving the distinct parts of a concrete (X)HTML string might not be the most useful task for a seasoned PHP developer, it's valid to mention here that the Tidy library comes equipped with a remarkable set of functions for breaking up a web document in its main section, in this way allowing users to parse the different nodes of the document in question in a simpler way.

    All right, at this stage you've hopefully learned how to parse and fix the format of a given (X)HTML file via its specific set of Tidy functions, in addition to splitting a file into its most important pieces. So, the question that comes up is the following: what is the next step? Well, from a PHP developer's point of view, tracking all the errors that occurred when parsing a concrete (X)HTML string might be quite useful. Therefore, in this final tutorial of the series I'm going to cover some new functions bundled with the Tidy extension which are designed to show you the potential errors raised when interpreting (X)HTML data.

    Now, with the preliminaries out of our way, it's time to tackle this last article of the series and learn how to handle parsing errors with the Tidy extension. Let's move on!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this final part of the series, several functions bundled with the...
     

       

    PHP ARTICLES

    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview
    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway