DOM 2 util.
More...
DOM 2 util.
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$ /
Definition at line 11 of file class.ilDOM2Util.php.
◆ addParent()
static ilDOM2Util::addParent |
( |
|
$node, |
|
|
|
$name |
|
) |
| |
|
static |
Add parent.
- Parameters
-
- Returns
Definition at line 44 of file class.ilDOM2Util.php.
References $name.
Referenced by ilPCParagraph\handleAjaxContent().
46 $newnode = $node->ownerDocument->createElement(
$name);
49 $par = $node->parentNode;
52 if ($next_sib = $node->nextSibling) {
53 $newnode = $par->insertBefore($newnode, $next_sib);
55 $newnode = $par->appendChild($newnode);
58 $node = $par->removeChild($node);
59 $newnode->appendChild($node);
◆ changeName()
static ilDOM2Util::changeName |
( |
|
$node, |
|
|
|
$name, |
|
|
|
$keep_attributes = true |
|
) |
| |
|
static |
Change name of a node.
- Parameters
-
object | $node | |
| string | new name |
- Returns
Definition at line 20 of file class.ilDOM2Util.php.
References $name.
Referenced by ilPCParagraph\handleAjaxContent().
22 $newnode = $node->ownerDocument->createElement(
$name);
24 foreach ($node->childNodes as $child) {
25 $child2 = $child->cloneNode(
true);
26 $newnode->appendChild($child2);
28 if ($keep_attributes) {
29 foreach ($node->attributes as $attrName => $attrNode) {
30 $newnode->setAttribute($attrName, $attrNode);
33 $node->parentNode->replaceChild($newnode, $node);
◆ replaceByChilds()
static ilDOM2Util::replaceByChilds |
( |
|
$node | ) |
|
|
static |
Replace a node by its child.
- Parameters
-
- Returns
Definition at line 76 of file class.ilDOM2Util.php.
Referenced by ilPCParagraph\handleAjaxContent().
78 foreach ($node->childNodes as $child) {
79 $child2 = $child->cloneNode(
true);
80 $node->parentNode->insertBefore($child2, $node);
82 $node->parentNode->removeChild($node);
The documentation for this class was generated from the following file: