class vB_SpecialtyTagParser

A derivative of an HTML/XML tokenizing parser, used to parse special tags.

Parses special tags embedded in an HTML document. This differs from a standard HTML parser in that the special tags can be embedded within valid HTML tags. Eg: href=""> Only the named tags are treated as tags; all other data is treated as text.

Uses state based parsing to move through the string, maintaining a pointer to the current position in the string.

Methods

__construct(string $namespace = 'vb', array $tag_list = array())

Constructor. Sets up the class and creates the tag search array as an optimization.

get_errors()

Returns any parse errors.

array
get_tokens()

Returns then tokens associated with the parser

array
parse(string $data)

Parses the data into tokens.

array
fetch_dom_compatible()

Fetchs a DOM-class compatible version of the tokens.

Details

at line 80
__construct(string $namespace = 'vb', array $tag_list = array())

Constructor. Sets up the class and creates the tag search array as an optimization.

Parameters

string $namespace An optional namespace to search in. If no tag list is specified, all tags in the namespace will be found.
array $tag_list An optional list of valid tags.

at line 109
get_errors()

Returns any parse errors.

at line 119
array get_tokens()

Returns then tokens associated with the parser

Return Value

array

at line 320
array parse(string $data)

Parses the data into tokens.

Parameters

string $data The data to parse

Return Value

array The tokenized data

at line 773
array fetch_dom_compatible()

Fetchs a DOM-class compatible version of the tokens.

Note that this only works if the token list is valid XML! It will error otherwise!

Return Value

array DOM-compatible output