@@ 405-414 (lines=10) @@ | ||
402 | * The $newnode, properly attached to DOMDocument. If you passed $newnode as a DOMElement |
|
403 | * then you should replace your DOMElement with the returned one. |
|
404 | */ |
|
405 | public function prepend($newnode, $context = NULL) { |
|
406 | $this->createContext($newnode, 'xml'); |
|
407 | $this->createContext($context, 'xpath'); |
|
408 | ||
409 | if (!$context || !$newnode) { |
|
410 | return FALSE; |
|
411 | } |
|
412 | ||
413 | return $context->insertBefore($newnode, $context->firstChild); |
|
414 | } |
|
415 | ||
416 | /** |
|
417 | * Prepend a sibling to the context node, put it just before the context node |
|
@@ 430-439 (lines=10) @@ | ||
427 | * The $newnode, properly attached to DOMDocument. If you passed $newnode as a DOMElement |
|
428 | * then you should replace your DOMElement with the returned one. |
|
429 | */ |
|
430 | public function prependSibling($newnode, $context = NULL) { |
|
431 | $this->createContext($newnode, 'xml'); |
|
432 | $this->createContext($context, 'xpath'); |
|
433 | ||
434 | if (!$context || !$newnode) { |
|
435 | return FALSE; |
|
436 | } |
|
437 | ||
438 | return $context->parentNode->insertBefore($newnode, $context); |
|
439 | } |
|
440 | ||
441 | /** |
|
442 | * Append a sibling to the context node, put it just after the context node |