ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
HTMLPurifier_Token_Text Class Reference

Concrete text token class. More...

+ Inheritance diagram for HTMLPurifier_Token_Text:
+ Collaboration diagram for HTMLPurifier_Token_Text:

Public Member Functions

 __construct ($data, $line=null, $col=null)
 Constructor, accepts data and determines if it is whitespace. More...
 
 toNode ()
 
- Public Member Functions inherited from HTMLPurifier_Token
 __get ($n)
 
 position ($l=null, $c=null)
 Sets the position of the token in the source document. More...
 
 rawPosition ($l, $c)
 Convenience function for DirectLex settings line/col position. More...
 
 toNode ()
 Converts a token into its corresponding node. More...
 

Data Fields

 $name = '#PCDATA'
 string More...
 
 $data
 string More...
 
 $is_whitespace
 bool More...
 
- Data Fields inherited from HTMLPurifier_Token
 $line
 Line number node was on in source document. More...
 
 $col
 Column of line node was on in source document. More...
 
 $armor = array()
 Lookup array of processing that this token is exempt from. More...
 
 $skip
 Used during MakeWellFormed. More...
 
 $rewind
 
 $carryover
 

Detailed Description

Concrete text token class.

Text tokens comprise of regular parsed character data (PCDATA) and raw character data (from the CDATA sections). Internally, their data is parsed with all entities expanded. Surprisingly, the text token does have a "tag name" called #PCDATA, which is how the DTD represents it in permissible child nodes.

Definition at line 12 of file Text.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_Token_Text::__construct (   $data,
  $line = null,
  $col = null 
)

Constructor, accepts data and determines if it is whitespace.

Parameters
string$dataString parsed character data.
int$line
int$col

Definition at line 40 of file Text.php.

References HTMLPurifier_Token\$col, $data, HTMLPurifier_Token\$line, and data.

41  {
42  $this->data = $data;
43  $this->is_whitespace = ctype_space($data);
44  $this->line = $line;
45  $this->col = $col;
46  }
$line
Line number node was on in source document.
Definition: Token.php:12
$this data['403_header']
$col
Column of line node was on in source document.
Definition: Token.php:18

Member Function Documentation

◆ toNode()

HTMLPurifier_Token_Text::toNode ( )

Definition at line 48 of file Text.php.

References data.

48  {
49  return new HTMLPurifier_Node_Text($this->data, $this->is_whitespace, $this->line, $this->col);
50  }
Concrete text token class.
Definition: Text.php:12
$this data['403_header']

Field Documentation

◆ $data

HTMLPurifier_Token_Text::$data

string

Parsed character data of text.

Definition at line 24 of file Text.php.

Referenced by __construct().

◆ $is_whitespace

HTMLPurifier_Token_Text::$is_whitespace

bool

Bool indicating if node is whitespace.

Definition at line 30 of file Text.php.

◆ $name

HTMLPurifier_Token_Text::$name = '#PCDATA'

string

PCDATA tag name compatible with DTD.

Definition at line 18 of file Text.php.


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