|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-09-14 10:17 UTC] ladislav dot prosek at matfyz dot cz
Description:
------------
Calling appendData() on a DOMComment seems to have zero effect on the comment.
Reproduce code:
---------------
<?
$doc = new DOMDocument;
$x = $doc->createComment("a");
$x->appendData("b");
echo $x->nodeValue;
?>
Expected result:
----------------
ab
Actual result:
--------------
a
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 21:00:02 2025 UTC |
Tell that to libxml2 authors? tree.c: .... int xmlTextConcat(xmlNodePtr node, const xmlChar *content, int len) { if (node == NULL) return(-1); if ((node->type != XML_TEXT_NODE) && (node->type != XML_CDATA_SECTION_NODE)) { #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, "xmlTextConcat: node is not text nor CDATA\n"); #endif return(-1); } ....If you replace $x->appendData("b") with $x->insertData(1, "b"), it will produce the expected output. Clearly it is a bug, in PHP or libxml2 (and definitely not bogus). If you're convinced that it's not in PHP, then someone should report it to libxml2. Will you do it or should I?