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 47 of file class.ilDOM2Util.php.
Referenced by ilPCParagraph\handleAjaxContent().
49 $newnode = $node->ownerDocument->createElement($name);
52 $par = $node->parentNode;
55 if ($next_sib = $node->nextSibling)
57 $newnode = $par->insertBefore($newnode, $next_sib);
61 $newnode = $par->appendChild($newnode);
64 $node = $par->removeChild($node);
65 $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.
Referenced by ilPCParagraph\handleAjaxContent().
22 $newnode = $node->ownerDocument->createElement($name);
24 foreach ($node->childNodes as $child)
26 $child2 = $child->cloneNode(
true);
27 $newnode->appendChild($child2);
31 foreach ($node->attributes as $attrName => $attrNode)
33 $newnode->setAttribute($attrName, $attrNode);
36 $node->parentNode->replaceChild($newnode, $node);
◆ replaceByChilds()
static ilDOM2Util::replaceByChilds |
( |
|
$node | ) |
|
|
static |
Replace a node by its child.
- Parameters
-
- Returns
Definition at line 82 of file class.ilDOM2Util.php.
Referenced by ilPCParagraph\handleAjaxContent().
84 foreach ($node->childNodes as $child)
86 $child2 = $child->cloneNode(
true);
87 $node->parentNode->insertBefore($child2, $node);
89 $node->parentNode->removeChild($node);
The documentation for this class was generated from the following file: