@@ 362-371 (lines=10) @@ | ||
359 | * The $newnode, properly attached to DOMDocument. If you passed $newnode as a DOMElement |
|
360 | * then you should replace your DOMElement with the returned one. |
|
361 | */ |
|
362 | public function append($newnode, $context = NULL) { |
|
363 | $this->createContext($newnode, 'xml'); |
|
364 | $this->createContext($context, 'xpath'); |
|
365 | ||
366 | if (!$context || !$newnode) { |
|
367 | return FALSE; |
|
368 | } |
|
369 | ||
370 | return $context->appendChild($newnode); |
|
371 | } |
|
372 | ||
373 | /** |
|
374 | * Append a child to the context node, make it the first child |
|
@@ 387-396 (lines=10) @@ | ||
384 | * The $newnode, properly attached to DOMDocument. If you passed $newnode as a DOMElement |
|
385 | * then you should replace your DOMElement with the returned one. |
|
386 | */ |
|
387 | public function prepend($newnode, $context = NULL) { |
|
388 | $this->createContext($newnode, 'xml'); |
|
389 | $this->createContext($context, 'xpath'); |
|
390 | ||
391 | if (!$context || !$newnode) { |
|
392 | return FALSE; |
|
393 | } |
|
394 | ||
395 | return $context->insertBefore($newnode, $context->firstChild); |
|
396 | } |
|
397 | ||
398 | /** |
|
399 | * Prepend a sibling to the context node, put it just before the context node |
|
@@ 412-421 (lines=10) @@ | ||
409 | * The $newnode, properly attached to DOMDocument. If you passed $newnode as a DOMElement |
|
410 | * then you should replace your DOMElement with the returned one. |
|
411 | */ |
|
412 | public function prependSibling($newnode, $context = NULL) { |
|
413 | $this->createContext($newnode, 'xml'); |
|
414 | $this->createContext($context, 'xpath'); |
|
415 | ||
416 | if (!$context || !$newnode) { |
|
417 | return FALSE; |
|
418 | } |
|
419 | ||
420 | return $context->parentNode->insertBefore($newnode, $context); |
|
421 | } |
|
422 | ||
423 | /** |
|
424 | * Append a sibling to the context node, put it just after the context node |