ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
HTMLPurifier_Node_Element Class Reference

Concrete element node class. More...

+ Inheritance diagram for HTMLPurifier_Node_Element:
+ Collaboration diagram for HTMLPurifier_Node_Element:

Public Member Functions

 __construct ($name, $attr=array(), $line=null, $col=null, $armor=array())
 
 toTokenPair ()
 Returns a pair of start and end tokens, where the end token is null if it is not necessary. More...
 
 toTokenPair ()
 Returns a pair of start and end tokens, where the end token is null if it is not necessary. More...
 

Data Fields

 $name
 The lower-case name of the tag, like 'a', 'b' or 'blockquote'. More...
 
 $attr = array()
 Associative array of the node's attributes. More...
 
 $children = array()
 List of child elements. More...
 
 $empty = false
 Does this use the form or the form, i.e. More...
 
 $endCol = null
 
 $endLine = null
 
 $endArmor = array()
 
- Data Fields inherited from HTMLPurifier_Node
 $line
 Line number of the start token in the source document @type int. More...
 
 $col
 Column number of the start token in the source document. More...
 
 $armor = array()
 Lookup array of processing that this token is exempt from. More...
 
 $dead = false
 When true, this node should be ignored as non-existent. More...
 

Detailed Description

Concrete element node class.

Definition at line 6 of file Element.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_Node_Element::__construct (   $name,
  $attr = array(),
  $line = null,
  $col = null,
  $armor = array() 
)

Definition at line 39 of file Element.php.

39 {
40 $this->name = $name;
41 $this->attr = $attr;
42 $this->line = $line;
43 $this->col = $col;
44 $this->armor = $armor;
45 }
$name
The lower-case name of the tag, like 'a', 'b' or 'blockquote'.
Definition: Element.php:16
$attr
Associative array of the node's attributes.
Definition: Element.php:22
$armor
Lookup array of processing that this token is exempt from.
Definition: Node.php:30
$line
Line number of the start token in the source document @type int.
Definition: Node.php:17
$col
Column number of the start token in the source document.
Definition: Node.php:23

References HTMLPurifier_Node\$armor, $attr, HTMLPurifier_Node\$col, HTMLPurifier_Node\$line, and $name.

Member Function Documentation

◆ toTokenPair()

HTMLPurifier_Node_Element::toTokenPair ( )

Returns a pair of start and end tokens, where the end token is null if it is not necessary.

Does not include children. @type array

Reimplemented from HTMLPurifier_Node.

Definition at line 47 of file Element.php.

47 {
48 // XXX inefficiency here, normalization is not necessary
49 if ($this->empty) {
50 return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null);
51 } else {
52 $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor);
53 $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor);
54 //$end->start = $start;
55 return array($start, $end);
56 }
57 }
Concrete empty token class.
Definition: Empty.php:7
Concrete end token class.
Definition: End.php:11
Concrete start token class.
Definition: Start.php:7

Field Documentation

◆ $attr

HTMLPurifier_Node_Element::$attr = array()

Associative array of the node's attributes.

@type array

Definition at line 22 of file Element.php.

Referenced by __construct().

◆ $children

HTMLPurifier_Node_Element::$children = array()

List of child elements.

@type array

Definition at line 28 of file Element.php.

◆ $empty

HTMLPurifier_Node_Element::$empty = false

Does this use the form or the form, i.e.

is it a pair of start/end tokens or an empty token. @bool

Definition at line 35 of file Element.php.

◆ $endArmor

HTMLPurifier_Node_Element::$endArmor = array()

Definition at line 37 of file Element.php.

◆ $endCol

HTMLPurifier_Node_Element::$endCol = null

Definition at line 37 of file Element.php.

◆ $endLine

HTMLPurifier_Node_Element::$endLine = null

Definition at line 37 of file Element.php.

◆ $name

HTMLPurifier_Node_Element::$name

The lower-case name of the tag, like 'a', 'b' or 'blockquote'.

Note
Strictly speaking, XML tags are case sensitive, so we shouldn't be lower-casing them, but these tokens cater to HTML tags, which are insensitive. @type string

Definition at line 16 of file Element.php.

Referenced by __construct().


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