日期:2013-04-10  浏览次数:20451 次

This is a HTML parser class, used to parse HTML and XML. One of the unique features of this class is that it supports the innerHTML property.

<?php

/**
 * HTML/XML Parser Class
 *
 * This is a helper class that is used to parse HTML and XML. A unique feature of this parsing class 
 * is the fact that it includes support for innerHTML (which isn't easy to do).
 *
 * @author Dennis Pallett
 * @copyright Dennis Pallett 2006
 * @package HTML_Parser
 * @version 1.0
 */

// Helper Class
// To parse HTML/XML
Class HTML_Parser 
{
    
// Private properties
    
var $_parser
;
    var 
$_tags 
= array();
    var 
$_html
;
    var 
$output 
= array();
    var 
$strXmlData
;
    var 
$_level 0
;
    var 
$_outline
;
    var 
$_tagcount 
= array();
    var 
$xml_error false
;
    var 
$xml_error_code
;
    var