#44048 [Opn->Bgs]: xmlwriter::writeAttribute() does not work after xmlwriter::text() call

From: Date: Tue, 05 Feb 2008 02:48:52 +0000
Subject: #44048 [Opn->Bgs]: xmlwriter::writeAttribute() does not work after xmlwriter::text() call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121983@lists.php.net to get a copy of this message
ID: 44048 Updated by: pajoye@php.net 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

« previous php.bugs (#121983) next »