|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23326 DomNode->append_child() does not append attribute nodes
Submitted: 2003-04-24 08:18 UTC Modified: 2003-09-09 15:49 UTC
Avg. Score:4.3 ± 1.1
Reproduced:4 of 5 (80.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: markus dot pfefferle at web dot de Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4CVS-2003-04-24 (stable) OS: Windows 2000
Private report: No CVE-ID:
 [2003-04-24 08:18 UTC] markus dot pfefferle at web dot de
This works:

  $document = domxml_new_doc('1.0');
  $test = $document->append_child($document->create_element('test'));
  $test->set_attribute('key', 'value');
  echo htmlspecialchars($document->dump_mem(1));

This does not:

  $document = domxml_new_doc('1.0');
  $test = $document->append_child($document->create_element('test'));
  $test->append_child($document->create_attribute('key', 'value'));
  echo htmlspecialchars($document->dump_mem(1));

Also doesn't work on 4.3.1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-25 03:59 UTC]
isn't implemented

you have to use $element->set_attribute_node()

which only is available in CVS HEAD. You could try the php_domxml.dll from the latest cvs-snapshot
 [2003-04-25 04:16 UTC] markus dot pfefferle at web dot de
How my daddy used to day:

"if it ain't implemented, don't document it!"
 [2003-04-25 04:17 UTC] markus dot pfefferle at web dot de
Forgot the entry that I'm refering to:
 [2003-08-22 13:18 UTC] p0wer at bojko dot krakow dot pl
Does not work for 4.3.3RC3 on Linux (Debian Sid) either.
 [2003-09-09 15:49 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 15:01:40 2015 UTC