note 37265 deleted from ref.xml by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Mar 2010 18:42:34 +0000 |
| Subject: | note 37265 deleted from ref.xml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166598@lists.php.net to get a copy of this message | ||
Note Submitter: chris at hitcatcher dot com
----
In regards to jon at gettys dot org's XML object, The data should be TRIM()ed to remove any
whitespace that could appear in CDATA entered as :
<xml_tag>
cdata here. cdata here. cdata here. cdata here.
</xml_tag>
So, after applying fred at barron dot com's suggested change to the characterData function, the
function should appear as:
function characterData($parser, $data)
{
global $obj;
$data = addslashes($data);
eval($obj->tree."->data.='".trim($data)."';");
}
SIDE NOTE: I'm fairly new to XML so perhaps it is considered bad form to enter CDATA as I did
in my example. Is this true or is the extra whitespace for the sake of readablity acceptable?