Annotation of embedaddon/php/ext/dom/tests/dom_xinclude.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test: Xinclude and Streams
                      3: --SKIPIF--
                      4: <?php
                      5: require_once('skipif.inc');
                      6: in_array('compress.zlib', stream_get_wrappers()) or die('skip compress.zlib wrapper is not available');
                      7: ?>
                      8: --FILE--
                      9: <?php
                     10: $dom = new domdocument;
                     11: 
                     12: $data = file_get_contents(dirname(__FILE__)."/xinclude.xml");
                     13: $reldir = str_replace(getcwd(),".",dirname(__FILE__));
                     14: if (DIRECTORY_SEPARATOR == '\\') {
                     15:        $reldir = str_replace('\\',"/", $reldir);
                     16: }
                     17: $data = str_replace('compress.zlib://ext/dom/tests/','compress.zlib://'.$reldir."/", $data);
                     18: 
                     19: 
                     20: $dom->loadXML($data);
                     21: $dom->xinclude();
                     22: print $dom->saveXML()."\n";
                     23: foreach ($dom->documentElement->childNodes as $node) {
                     24:        print $node->nodeName."\n";
                     25: }
                     26: ?>
                     27: --EXPECTF--
                     28: <?xml version="1.0"?>
                     29: <foo xmlns:xi="http://www.w3.org/2001/XInclude">
                     30:     <book xml:base="compress.zlib://%sbook.xml">
                     31:   <title>The Grapes of Wrath</title>
                     32:   <author>John Steinbeck</author>
                     33:  </book><book xml:base="compress.zlib://%sbook.xml">
                     34:   <title>The Pearl</title>
                     35:   <author>John Steinbeck</author>
                     36:  </book>
                     37:  </foo>
                     38: 
                     39: #text
                     40: book
                     41: book
                     42: #text

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>