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 28 29
|
--TEST--
SimpleXMLElement::asXML() with a fragment and a filename
--EXTENSIONS--
simplexml
--FILE--
<?php
$sxe = simplexml_load_string(<<<XML
<?xml version="1.0"?>
<container>
<container2>
<child id="foo">bar</child>
</container2>
</container>
XML);
$sxe->container2->asXML(__DIR__."/SimpleXMLElement_asXML_fragment_filename_output.tmp");
// Note: the strange indent is correct: the indent text node preceding container2 is not emitted.
echo file_get_contents(__DIR__."/SimpleXMLElement_asXML_fragment_filename_output.tmp");
?>
--CLEAN--
<?php
@unlink(__DIR__."/SimpleXMLElement_asXML_fragment_filename_output.tmp");
?>
--EXPECT--
<container2>
<child id="foo">bar</child>
</container2>
|