contenido\classes\class.htmlparser.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

Description: HTML parser for contenido

Requirements:

Author
Starnetsys, LLC.  
Con_php_req
5.0  
Copyright
Starnetsys, LLC.  
Link
http://starnetsys.com  
Package
Contenido Backend classes  
Since
file available since contenido release <= 4.6 {@internal created unknown modified 2008-07-02, Frederic Schneider, add security fix modified 2009-10-23, Murat Purc, removed deprecated function (PHP 5.3 ready) $Id: class.htmlparser.php 1085 2009-10-24 02:01:34Z xmurrix $: }}  
Version
1.0.2  

Constants

>VConstant  NODE_TYPE_START = 0
>VConstant  NODE_TYPE_ELEMENT = 1
>VConstant  NODE_TYPE_ENDELEMENT = 2
>VConstant  NODE_TYPE_TEXT = 3
>VConstant  NODE_TYPE_COMMENT = 4
>VConstant  NODE_TYPE_DONE = 5

\HtmlParser

Package: Default
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.

Properties

>VPropertypublic$iHtmlText
Details
Type
n/a
>VPropertypublic$iHtmlTextIndex = 0
Default value0Details
Type
n/a
>VPropertypublic$iHtmlTextLength
Details
Type
n/a
>VPropertypublic$iNodeAttributes
Field iNodeAttributes.

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

Details
Type
n/a
>VPropertypublic$iNodeName = ""
Field iNodeName.

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

Default value""Details
Type
n/a
>VPropertypublic$iNodeType
Field iNodeType.

May be one of the NODE_TYPE_* constants above.

Details
Type
n/a
>VPropertypublic$iNodeValue = ""
Field iNodeValue.

For text nodes, it's the text.

Default value""Details
Type
n/a

Methods

methodpublicHtmlParser( $aHtmlText) : void

Constructor.

Constructs an HtmlParser instance with the HTML text given.

Parameters
NameTypeDescription
$aHtmlText
methodpublicclearAttributes() : void

methodpubliccurrentChar() : void

methodpublicisValidTagIdentifier( $name) : void

Parameters
NameTypeDescription
$name
methodpublicmoveNext() : void

methodpublicparse() : void

Method parse.

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

methodpublicreadTag() : void

methodpublicreadValueInTag() : void

methodpublicskipBlanksInTag() : void

methodpublicskipEndOfTag() : void

methodpublicskipEqualsInTag() : void

methodpublicskipInTag( $chars) : void

Parameters
NameTypeDescription
$chars
methodpublicskipToBlanksInTag() : void

methodpublicskipToBlanksOrEqualsInTag() : void

methodpublicskipToElement() : void

methodpublicskipToInTag( $chars) : void

Parameters
NameTypeDescription
$chars
methodpublicskipToStringInTag( $needle) : void

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
NameTypeDescription
$needle
Documentation was generated by phpDocumentor 2.0.0a12.