Mantis - Quercus
Viewing Issue Advanced Details
4563 minor always 05-17-11 10:39 05-19-11 10:57
alex  
domdorn  
normal  
resolved 4.0.18  
fixed  
none    
none  
0004563: Quercus DOMDocument->saveXML($node) does not work
<?php

$doc = new DOMDocument('1.0');
// we want a nice output
$doc->formatOutput = true;

$root = $doc->createElement('book');
$root = $doc->appendChild($root);

$title = $doc->createElement('title');
$title = $root->appendChild($title);

$text = $doc->createTextNode('This is the title');
$text = $title->appendChild($text);

echo "Saving all the document:\n";
echo $doc->saveXML() . "\n";

echo "Saving only the title part:\n";
echo $doc->saveXML($title);

?>
expected output
Saving all the document:
<?xml version="1.0"?>
<book>
  <title>This is the title</title>
</book>

Saving only the title part:
<title>This is the title</title>

Notes
(0005261)
domdorn   
05-19-11 07:52   
we'll have to implement the saveXML( env, object ) method in
modules/quercus/src/com/caucho/quercus/lib/dom/DOMDocument.java
(0005263)
domdorn   
05-19-11 10:57   
php/1z22
php/1z23

resolved in current trunk, will be in 4.0.19