Bug #15412: set_content() and new_child() methods not creating wellformed XML

From: Date: Wed, 06 Feb 2002 22:34:26 +0000
Subject: Bug #15412: set_content() and new_child() methods not creating wellformed XML
Groups: php.dev 
Request: Send a blank email to php-dev+get-79423@lists.php.net to get a copy of this message
From: ken@positive-edge.com Operating system: WindowsXP PHP version: 4.1.1 PHP Bug Type: DOM XML related Bug description: set_content() and new_child() methods not creating wellformed XML There is a *large* bug in the the set_content() method (as well as the new_child() method) For instance, if i try to add a new node with content containing an entity like this, it will convert the entity to the original character. $bugItemNode->new_child( 'title', '' ); $bugItemNode->set_content( 'HtmlTagContainer&apos;s add() method does not accept strings as an argument.' ); But when you use $doc->dumpmem(), the output will be the following: ...<title>HtmlTagContainer's add() method does not accept strings as an argument.</title> Notice that it contains an apostrophe and it is NOT &apos;. This is a huge bug since it does not output wellformed XML files. Obviously, if you simply write the apostrophe character, it will do nothing to convert it to &apos; as well. This is serious and will hinder MANY applications that need to parse the resultant XML content. Developers, please fix this. Ken Egervari -- Edit bug report at http://bugs.php.net/?id=15412&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=15412&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=15412&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15412&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15412&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15412&r=support Expected behavior: http://bugs.php.net/fix.php?id=15412&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15412&r=notenoughinfo

« previous php.dev (#79423) next »