#41792 [Opn->Bgs]: simplexml newlines in attributes

From: Date: Mon, 25 Jun 2007 11:39:47 +0000
Subject: #41792 [Opn->Bgs]: simplexml newlines in attributes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114151@lists.php.net to get a copy of this message
ID: 41792 Updated by: rrichards@php.net Reported By: alexander dot krause at erazor-zone dot de -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Linux PHP Version: 5.2.3 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The newlines in the attribute values are being normalized: http://www.w3.org/TR/REC-xml/#AVNormalize Previous Comments: ------------------------------------------------------------------------ [2007-06-24 19:39:38] alexander dot krause at erazor-zone dot de Description: ------------ newlines in attributes are allowed (htmlentities also does not convert newlines to &#10; ) but they'll be removed when using simplexml. Reproduce code: --------------- $xml = new SimpleXMLElement( '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><str val="Line 1 Line2 Line3"/>' ); echo $xml->asXML(); Expected result: ---------------- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <str val="Line 1 Line2 Line3"/> Actual result: -------------- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <str val="Line 1 Line2 Line3"/> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41792&edit=1

« previous php.bugs (#114151) next »