Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

HTMLTokenSet Class Reference

List of all members.

Public Member Functions

 __construct ($escape=true)
 __tostring ()
 get_end_offset ()
 slice ($names, array $attr=null)
 trim_container ()
 replace_slice (HTMLTokenSet $slice)
 tokenize_replace ($source)
 insert (HTMLTokenset $set, $pos=0)
 rewind ()
 current ()
 key ()
 next ()
 valid ()
 end ()
 offsetExists ($offset)
 offsetGet ($offset)
 offsetSet ($offset, $value)
 offsetUnset ($offset)

Static Public Member Functions

static token_to_string (array $token, $escape=true)

Public Attributes

 $escape

Protected Member Functions

 find_slice ($offset, $name, array $attr)

Protected Attributes

 $tokens = array()
 $sliceOffsetBegin = null
 $sliceOffsetLength = null

Detailed Description

HTML Token Set (created by

See also:
HTMLTokenizer)

Definition at line 11 of file htmltokenset.php.


Member Function Documentation

HTMLTokenSet::find_slice ( offset,
name,
array $  attr 
) [protected]

This is a support function for HTMLTokenSet::slice(). It finds a specific slice

Parameters:
integer $offset The offset at which to start looking for relevant tokens
string $name The name of the html tag being searched for
array $attr The attributes of the html tag being searched for
Returns:
HTMLTokenSet

Definition at line 137 of file htmltokenset.php.

Referenced by slice().

HTMLTokenSet::get_end_offset (  ) 

Get the offset of the last token in this HTMLTokenSet

Returns:
integer the offset of the last token in this HTMLTokenSet

Definition at line 98 of file htmltokenset.php.

HTMLTokenSet::insert ( HTMLTokenset $  set,
pos = 0 
)

Insert an HTMLTokenset before the given position

Parameters:
HTMLTokenset $set. The HTMLTokenset to insert
integer $pos. The position to insert the HTMLTokenset before
Returns:
Nothing

Definition at line 258 of file htmltokenset.php.

HTMLTokenSet::replace_slice ( HTMLTokenSet slice  ) 

Replace a set of tokens in this HTMLTokenSet

Parameters:
HTMLTokenSet $slice The tokens to insert in place of the old tokens
Returns:
nothing

Definition at line 227 of file htmltokenset.php.

HTMLTokenSet::slice ( names,
array $  attr = null 
)

Fetch a section of the tokens, based on passed criteria

Parameters:
mixed $names The name of an html tag, or an array of names of html tags to get the tokens of
array $attr Any attributes for the token that you want to filter by
Returns:
array An array of the HTMLTokenSets that were found

Definition at line 110 of file htmltokenset.php.

static HTMLTokenSet::token_to_string ( array $  token,
escape = true 
) [static]

Convert a token to a string

Parameters:
array $token The token to convert
bool $escape Whether to escape the string that is returned
Returns:
string The string representation of the token

Definition at line 41 of file htmltokenset.php.

Referenced by InputFilter::filter_html_elements().

HTMLTokenSet::tokenize_replace ( source  ) 

Replace a full set of tokens with new tokens. The tokens are replaced in place as well as being returned

Parameters:
string $source The text to create the new set of tokens from
Returns:
HTMLTokenSet The new set of tokens created

Definition at line 244 of file htmltokenset.php.

HTMLTokenSet::trim_container (  ) 

Remove the first and last tokens from this HTMLTokenSet

Returns:
nothing

Definition at line 216 of file htmltokenset.php.


The documentation for this class was generated from the following file: