--TEST--
-Check for simplexml presence
+SimpleXML without CDATA
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
---POST--
---GET--
---INI--
--FILE--
<?php
-echo "simplexml extension is available";
-/*
- you can add regression tests for your extension here
-
- the output of your test code has to be equal to the
- text in the --EXPECT-- section below for the tests
- to pass, differences between the output and the
- expected text are interpreted as failure
-
- see php4/README.TESTING for further information on
- writing regression tests
-*/
+
+$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml');
+
+print_r($sxe);
+
+echo "---Done---\n";
+
?>
--EXPECT--
-simplexml extension is available
+simplexml_element Object
+(
+ [elem1] => simplexml_element Object
+ (
+ [comment] => simplexml_element Object
+ (
+ )
+
+ [elem2] => simplexml_element Object
+ (
+ [elem3] => simplexml_element Object
+ (
+ [included-entity] => simplexml_element Object
+ (
+ [included-entity] => This is text included from an entity
+ )
+
+ [elem4] => simplexml_element Object
+ (
+ [test] => simplexml_element Object
+ (
+ )
+
+ )
+
+ )
+
+ )
+
+ )
+
+)
+---Done---
--- /dev/null
+--TEST--
+SimpleXML and clone
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml');
+
+$copy = $sxe->__clone;
+
+print_r($copy);
+
+echo "---Done---\n";
+
+?>
+--EXPECT--
+simplexml_element Object
+(
+ [elem1] => simplexml_element Object
+ (
+ [comment] => simplexml_element Object
+ (
+ )
+
+ [elem2] => simplexml_element Object
+ (
+ [elem3] => simplexml_element Object
+ (
+ [included-entity] => simplexml_element Object
+ (
+ [included-entity] => This is text included from an entity
+ )
+
+ [elem4] => simplexml_element Object
+ (
+ [test] => simplexml_element Object
+ (
+ )
+
+ )
+
+ )
+
+ )
+
+ )
+
+)
+---Done---
--- /dev/null
+<?xml encoding='US-ASCII'?>\r
+\r
+<!ELEMENT sxe elem1>\r
+<!ATTLIST sxe id>\r
+\r
+<!ELEMENT elem1 elem2>\r
+<!ATTLIST elem1 attr1 CDATA #required\r
+ attr2 CDATA "default>\r
+\r
+<!ELEMENT elem2 elem3>\r
+<!ATTLIST elem2>\r
+\r
+<!ELEMENT elem3 elem4>\r
+<!ATTLIST elem3>\r
+\r
+<!ELEMENT elem4 EMPTY>\r
+<!ATTLIST elem4>\r
+\r
--- /dev/null
+<!ENTITY included-entity "This is text included from an entity">
--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd" [
+<!ENTITY % incent SYSTEM "sxe.ent">
+%incent;
+]>
+<sxe id="elem1">
+ Plain text.
+ <elem1 attr1='first'>
+ <!-- comment -->
+ <elem2>
+ <elem3>
+ &included-entity;
+ <elem4>
+ <?test processing instruction ?>
+ </elem4>
+ </elem3>
+ </elem2>
+ </elem1>
+</sxe>
\ No newline at end of file