From:             daju at passagen dot se
Operating system: Windows XP Home
PHP version:      5CVS-2003-11-02 (dev)
PHP Bug Type:     DOM XML related
Bug description:  save function isn't working

Description:
------------
Hi folks,

I just downloaded development version av PHP 5 (CVS 2003-11-02) and tried
the new DOM functions that uses libxml2 library. It's working great but
there is one thing that I don't understand.

I tried to update a xml file I have and I can add nodes and attributes but
when i try to save file then nothing happens. There is no error messages
at all.

How ever if I choose another file name for the save function then it is
working. New file is created and I see both the old and the new nodes in
the xml file.

Am I missing something here?

Reproduce code:
---------------
<?php
    echo "<h3>Just a simple DOM test</h3>";

    $dom = new domDocument();
    $load = $dom->load('test.xml');
    $root = $dom->documentElement;

    $element = $dom->createElement("temp", "Just a test text");
    $attr = $element->setAttribute("id", "0007");
    $attr = $element->setAttribute("author", "darren");
    $tmp = $root->appendChild($element);

    $tmp = $dom->save('test.xml');
    echo $tmp." bytes was saved to the xml file.";
?>

Expected result:
----------------
The file should be updated. Output i my browser should be:

363 bytes was saved to the xml file.

Actual result:
--------------
0 bytes was saved to the xml file.

-- 
Edit bug report at http://bugs.php.net/?id=26083&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26083&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26083&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26083&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26083&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26083&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26083&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26083&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26083&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26083&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26083&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26083&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26083&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26083&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26083&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26083&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26083&r=float

Reply via email to