ID:               49051
 Updated by:       [email protected]
 Reported By:      major at minet dot sk
-Status:           Open
+Status:           Feedback
 Bug Type:         XML Writer
 Operating System: Vista 32bit
 PHP Version:      5.3.0
 New Comment:

Since when is 'data/file.xml' a valid URI? Try with proper URI instead.


Previous Comments:
------------------------------------------------------------------------

[2009-07-24 16:22:35] major at minet dot sk

Description:
------------
When I try to write content of xml file using XMLWriter, it works fine
_only_ if xml file is in the same directory as php script. When path
contains slash or backslash, it is unable to open file.
My code works on 5.2.9 but fails when running on 5.3.0 (I use
WampServer).

Reproduce code:
---------------
<?php
$x = new XMLWriter();
$x->openURI('data/file.xml');
$x->startDocument('1.0', 'UTF-8');
$x->writeElement('root');
$x->endDocument();
print '<plaintext>'.file_get_contents('data/file.xml');
?>

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?> <root/> 

Actual result:
--------------
Warning: XMLWriter::openUri() [xmlwriter.openuri]: Unable to resolve
file path in C:\localhost\www\xml.php on line 3

Warning: XMLWriter::startDocument() [xmlwriter.startdocument]: Invalid
or unitialized XMLWriter object in C:\localhost\www\xml.php on line 4

Warning: XMLWriter::writeElement() [xmlwriter.writeelement]: Invalid or
unitialized XMLWriter object in C:\localhost\www\xml.php on line 5

Warning: XMLWriter::endDocument() [xmlwriter.enddocument]: Invalid or
unitialized XMLWriter object in C:\localhost\www\xml.php on line 6


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49051&edit=1

Reply via email to