@@ 399-408 (lines=10) @@ | ||
396 | * The $newnode, properly attached to DOMDocument. If you passed $newnode as a DOMElement |
|
397 | * then you should replace your DOMElement with the returned one. |
|
398 | */ |
|
399 | public function prepend($newnode, $context = NULL) { |
|
400 | $this->createContext($newnode, 'xml'); |
|
401 | $this->createContext($context, 'xpath'); |
|
402 | ||
403 | if (!$context || !$newnode) { |
|
404 | return FALSE; |
|
405 | } |
|
406 | ||
407 | return $context->insertBefore($newnode, $context->firstChild); |
|
408 | } |
|
409 | ||
410 | /** |
|
411 | * Prepend a sibling to the context node, put it just before the context node |
|
@@ 424-433 (lines=10) @@ | ||
421 | * The $newnode, properly attached to DOMDocument. If you passed $newnode as a DOMElement |
|
422 | * then you should replace your DOMElement with the returned one. |
|
423 | */ |
|
424 | public function prependSibling($newnode, $context = NULL) { |
|
425 | $this->createContext($newnode, 'xml'); |
|
426 | $this->createContext($context, 'xpath'); |
|
427 | ||
428 | if (!$context || !$newnode) { |
|
429 | return FALSE; |
|
430 | } |
|
431 | ||
432 | return $context->parentNode->insertBefore($newnode, $context); |
|
433 | } |
|
434 | ||
435 | /** |
|
436 | * Append a sibling to the context node, put it just after the context node |