go-utils
[ class tree: go-utils ] [ index: go-utils ] [ all elements ]

Class: HtmlParser

Source Location: /classes/htmlparser.class.inc

Class Overview


Class HtmlParser.


Variables

Methods



Class Details

[line 32]
Class HtmlParser.

To use, create an instance of the class passing HTML text. Then invoke parse() until it's false. When parse() returns true, $iNodeType, $iNodeName $iNodeValue and $iNodeAttributes are updated.

To create an HtmlParser instance you may also use convenience functions HtmlParser_ForFile and HtmlParser_ForURL.



[ Top ]


Class Variables

$iHtmlCurrentChar =

[line 65]


Type:   mixed


[ Top ]

$iHtmlText =

[line 62]


Type:   mixed


[ Top ]

$iHtmlTextIndex =  0

[line 64]


Type:   mixed


[ Top ]

$iHtmlTextLength =

[line 63]


Type:   mixed


[ Top ]

$iNodeAttributes =

[line 57]

Field iNodeAttributes.

A string-indexed array containing attribute values of the current node. Indexes are always lowercase.


Type:   mixed


[ Top ]

$iNodeName =  ""

[line 44]

Field iNodeName.

For elements, it's the name of the element.


Type:   mixed


[ Top ]

$iNodeType =

[line 38]

Field iNodeType.

May be one of the NODE_TYPE_* constants above.


Type:   mixed


[ Top ]

$iNodeValue =  ""

[line 50]

Field iNodeValue.

For text nodes, it's the text.


Type:   mixed


[ Top ]



Class Methods


constructor HtmlParser [line 72]

HtmlParser HtmlParser( $aHtmlText)

Constructor.

Constructs an HtmlParser instance with the HTML text given.

Parameters:

   $aHtmlText  

[ Top ]

method clearAttributes [line 95]

void clearAttributes( )

[ Top ]

method isValidTagIdentifier [line 162]

void isValidTagIdentifier( $name)

Parameters:

   $name  

[ Top ]

method moveNext [line 211]

void moveNext( )

[ Top ]

method parse [line 84]

void parse( )

Method parse.

Parses the next node. Returns false only if the end of the HTML text has been reached. Updates values of iNode* fields.

[ Top ]

method readTag [line 99]

void readTag( )

[ Top ]

method readValueInTag [line 182]

void readValueInTag( )

[ Top ]

method setTextIndex [line 201]

void setTextIndex( $index)

Parameters:

   $index  

[ Top ]

method skipBlanksInTag [line 166]

void skipBlanksInTag( )

[ Top ]

method skipEndOfTag [line 221]

void skipEndOfTag( )

[ Top ]

method skipEqualsInTag [line 178]

void skipEqualsInTag( )

[ Top ]

method skipInTag [line 234]

void skipInTag( $chars)

Parameters:

   $chars  

[ Top ]

method skipToBlanksInTag [line 174]

void skipToBlanksInTag( )

[ Top ]

method skipToBlanksOrEqualsInTag [line 170]

void skipToBlanksOrEqualsInTag( )

[ Top ]

method skipToElement [line 278]

void skipToElement( )

[ Top ]

method skipToInTag [line 257]

void skipToInTag( $chars)

Parameters:

   $chars  

[ Top ]

method skipToStringInTag [line 296]

void skipToStringInTag( $needle)

Returns text between current position and $needle, inclusive, or "" if not found. The current index is moved to a point after the location of $needle, or not moved at all if nothing is found.

Parameters:

   $needle  

[ Top ]


Documentation generated on Thu, 30 Oct 2008 14:13:34 +0100 by phpDocumentor 1.4.0