mirror of
https://github.com/php/php-src.git
synced 2024-10-21 16:33:44 +00:00
28 lines
611 B
PHP
28 lines
611 B
PHP
--TEST--
|
|
Interop Test: Import from SimpleXML
|
|
--SKIPIF--
|
|
<?php require_once('skipif.inc'); ?>
|
|
<?php if (!extension_loaded('simplexml')) die('skip simplexml extension not available');?>
|
|
--FILE--
|
|
<?php
|
|
$s = simplexml_load_file(dirname(__FILE__)."/book.xml");
|
|
if(!$s) {
|
|
echo "Error while loading the document\n";
|
|
exit;
|
|
}
|
|
$dom = dom_import_simplexml($s);
|
|
print $dom->ownerDocument->saveXML();
|
|
?>
|
|
--EXPECT--
|
|
<?xml version="1.0"?>
|
|
<books>
|
|
<book>
|
|
<title>The Grapes of Wrath</title>
|
|
<author>John Steinbeck</author>
|
|
</book>
|
|
<book>
|
|
<title>The Pearl</title>
|
|
<author>John Steinbeck</author>
|
|
</book>
|
|
</books>
|