Re: xinclude

From: Date: Mon, 19 Nov 2007 21:09:44 +0000
Subject: Re: xinclude
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-264800@lists.php.net to get a copy of this message
Sorry the code works fine, just forgot the echo the output. On Mon, 2007-11-19 at 22:04 +0100, Jonas Geiregat wrote: > I've been playing with DOMDocument->xinclude but it just doesn't seem to > work for me. > > test.php: > > <?php > header('set content-type: text/xml'); > $doc = new DomDocument; > > $doc->preserveWhiteSpace = false; > $doc->formatOutput = true; > > > $doc->load('test.xml'); > > $doc->xinclude(); > > $doc->saveXML(); > ?> > > test.xml: > > <?xml version="1.0"?> > > <bar > xmlns:xi="http://www.w3.org/2001/XInclude"> > <xi:include href="foo.xml"> > <xi:fallback> > <error>xinclude: book.xml not found</error> > </xi:fallback> > </xi:include> > </bar> > > foo.xml: > > <?xml version="1.0"?> > > > <test> > <foo>sfsd</foo> > </test> > > The output of test.php is nothing plain white space. > > Any help is appreciated. > > thanks in advance Jonas >

« previous php.general (#264800) next »