php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44048 xmlwriter::writeAttribute() does not work after xmlwriter::text() call
Submitted: 2008-02-05 01:40 UTC Modified: 2008-02-05 02:48 UTC
From: njones at art-k-tec dot com Assigned: pajoye (profile)
Status: Not a bug Package: XML Writer
PHP Version: 5.2.5 OS: linux / osx
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: njones at art-k-tec dot com
New email:
PHP Version: OS:

 

 [2008-02-05 01:40 UTC] 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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-05 02:48 UTC] pajoye@php.net
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).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC