1--TEST-- 2Tests DOMDocument::documentURI read and write 3--CREDITS-- 4Chris Snyder <chsnyder@gmail.com> 5# TestFest 2009 NYPHP 6--SKIPIF-- 7<?php require_once('skipif.inc'); ?> 8--FILE-- 9<?php 10// create dom document 11$dom = new DOMDocument; 12$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 13<!DOCTYPE s1 PUBLIC "http://www.ibm.com/example.dtd" "example.dtd"> 14<s1>foo</s1>'; 15$dom->loadXML($xml); 16if(!$dom) { 17 echo "Error while parsing the document\n"; 18 exit; 19} 20echo "DOMDocument created\n"; 21 22$test = $dom->documentURI; 23echo "Read initial documentURI:\n"; 24echo $test."\n"; 25 26$dom->documentURI = 'http://dom.example.org/example.xml'; 27$test = $dom->documentURI; 28echo "Set documentURI to a URL, reading again:\n"; 29var_dump( $test ); 30 31echo "Done\n"; 32?> 33--EXPECTF-- 34DOMDocument created 35Read initial documentURI: 36%s 37Set documentURI to a URL, reading again: 38string(34) "http://dom.example.org/example.xml" 39Done 40