1: | <?php
|
2: |
|
3: | |
4: | |
5: |
|
6: | class HTMLPurifier_Node_Element extends HTMLPurifier_Node
|
7: | {
|
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: |
|
16: | public $name;
|
17: |
|
18: | |
19: | |
20: | |
21: |
|
22: | public $attr = array();
|
23: |
|
24: | |
25: | |
26: | |
27: |
|
28: | public $children = array();
|
29: |
|
30: | |
31: | |
32: | |
33: | |
34: |
|
35: | public $empty = false;
|
36: |
|
37: | public $endCol = null, $endLine = null, $endArmor = array();
|
38: |
|
39: | public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) {
|
40: | $this->name = $name;
|
41: | $this->attr = $attr;
|
42: | $this->line = $line;
|
43: | $this->col = $col;
|
44: | $this->armor = $armor;
|
45: | }
|
46: |
|
47: | public function toTokenPair() {
|
48: |
|
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: |
|
55: | return array($start, $end);
|
56: | }
|
57: | }
|
58: | }
|
59: |
|
60: | |