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