PHP Class pQuery\HtmlParserBase

Functionality can be extended by overriding functions or adjusting the tag map. Document may contain small errors, the parser will try to recover and resume parsing.
Inheritance: extends TokenizerBase
Exibir arquivo Open project: tburry/pquery

Public Properties

Property Type Description
$custom_char_map Map characters to match their tokens
$identifiers Sets HTML identifiers, tags/attributes are considered identifiers
$status array Status of the parser (tagname, closing tag, etc)
$tag_map Callback functions for certain tags

Public Methods

Method Description
__construct ( $doc = '', $pos )
parse_all ( ) : boolean Parse full document
parse_asp ( ) : boolean Parse asp tags
parse_attributes ( ) : boolean Parse attributes (names + value)
parse_cdata ( ) : boolean Parse cdata tag
parse_comment ( ) : boolean Parse comment tags
parse_conditional ( ) : boolean Parse conditional tags (+ all conditional tags inside)
parse_doctype ( ) : boolean Parse doctype tag
parse_php ( ) : boolean Parse php tags
parse_script ( ) : boolean Parse script tags
parse_style ( ) : boolean Parse style tags
parse_tag ( ) : boolean Parse tag
parse_tag_default ( ) : boolean Default callback for tags
parse_text ( ) Parse text between tags

Protected Methods

Method Description
parse_string ( ) : integer Parse a HTML string (attributes)

Method Details

__construct() public method

public __construct ( $doc = '', $pos )

parse_all() public method

Parse full document
public parse_all ( ) : boolean
return boolean

parse_asp() public method

Parse asp tags
public parse_asp ( ) : boolean
return boolean

parse_attributes() public method

Parse attributes (names + value)
public parse_attributes ( ) : boolean
return boolean

parse_cdata() public method

Parse cdata tag
public parse_cdata ( ) : boolean
return boolean

parse_comment() public method

Parse comment tags
public parse_comment ( ) : boolean
return boolean

parse_conditional() public method

Parse conditional tags (+ all conditional tags inside)
public parse_conditional ( ) : boolean
return boolean

parse_doctype() public method

Parse doctype tag
public parse_doctype ( ) : boolean
return boolean

parse_php() public method

Parse php tags
public parse_php ( ) : boolean
return boolean

parse_script() public method

Parse script tags
public parse_script ( ) : boolean
return boolean

parse_string() protected method

Parse a HTML string (attributes)
protected parse_string ( ) : integer
return integer

parse_style() public method

Parse style tags
public parse_style ( ) : boolean
return boolean

parse_tag() public method

Parse tag
public parse_tag ( ) : boolean
return boolean

parse_tag_default() public method

Default callback for tags
public parse_tag_default ( ) : boolean
return boolean

parse_text() public method

Parse text between tags
public parse_text ( )

Property Details

$custom_char_map public_oe property

Map characters to match their tokens
See also: TokenizerBase::$custom_char_map
public $custom_char_map

$identifiers public_oe property

Sets HTML identifiers, tags/attributes are considered identifiers
See also: TokenizerBase::$identifiers
public $identifiers

$status public_oe property

Status of the parser (tagname, closing tag, etc)
public array $status
return array

$tag_map public_oe property

Callback functions for certain tags
public $tag_map