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--
replaceChild with attribute children
--EXTENSIONS--
dom
--FILE--
<?php
$dom = new DOMDocument;
$attr = $dom->createAttribute('attr');
$attr->textContent = "test";
try {
$attr->replaceChild($dom->createProcessingInstruction('pi'), $attr->firstChild);
} catch (DOMException $e) {
echo $e->getMessage(), "\n";
}
$root = $dom->appendChild($dom->createElement('root'));
$root->setAttributeNode($attr);
echo $dom->saveXML();
?>
--EXPECT--
Hierarchy Request Error
<?xml version="1.0"?>
<root attr="test"/>
|