ID: 44048
Updated by: [EMAIL PROTECTED]
Reported By: njones at art-k-tec dot com
-Status: Open
+Status: Bogus
Bug Type: XML Writer
Operating System: linux / osx
PHP Version: 5.2.5
-Assigned To:
+Assigned To: pajoye
New Comment:
An attribute can only be part of a tag, beginning a text will
automatically close the last opened tag (root in this case) and then
write the text, not a bug (means bogus here).
Previous Comments:
------------------------------------------------------------------------
[2008-02-05 01:40:52] njones at art-k-tec dot com
Description:
------------
Using the xmlwriter::writeAttribute() method after using a
xmlwriter::text() or xmlwriter::writeCData() method does not work.
Reproduce code:
---------------
$x = new XmlWriter();
$x->openMemory();
$x->startElement("root");
$x->text("hello word");
$x->writeAttribute("foo", "bar");
$x->endElement();
$s = $x->outputMemory(true);
echo $s;
Expected result:
----------------
<root foo="bar">hello world</root>
Actual result:
--------------
<root>hello world</root>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44048&edit=1