blob: ceaf72678a6a5dfe352165d82a134a036358b57b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
--TEST--
DOMNode::replaceWith()
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
require_once("dom_test.inc");
$dom = new DOMDocument;
$dom->loadXML('<test><mark>first</mark><mark>second</mark></test>');
$element = $dom->documentElement->firstChild;
$element->replaceWith(
$dom->createElement('element', 'content'),
'content'
);
print_node_list_compact($dom->documentElement->childNodes);
?>
--EXPECT--
<element>
content
</element>
content
<mark>
second
</mark>
|