|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-05-20 11:27 UTC] chregu@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC | 
set_content() handles XML entities differently, depending on context. Take a look at following example: <?php $xml = domxml_new_doc('1.0'); $root = $xml->append_child($xml->create_element('root')); $root->set_content(' '); $root->set_content(' '); echo $xml->dumpmem(); ?> It produces following document: <?xml version="1.0"?> <root> &#160;</root> Note, that first entity was determined as entity, but second - as plain text, and hence quoted. Problem is in php_domxml.c, function domxml_node_set_content(), around line 2734 (as for version) 1.218.2.23: if (nodep->children) { xmlNodeAddContentLen(nodep, content, content_len); } else { xmlNodeSetContentLen(nodep, content, content_len); } If you'll take a look into source of these functions in libxml (file tree.c) - you will see, that xmlNodeSetContentLen() parses given content for entities, while xmlNodeAddContentLen() - not.