note 37265 added to ref.xml

From: Date: Fri, 07 Nov 2003 19:48:04 +0000
Subject: note 37265 added to ref.xml
Groups: php.notes 
Request: Send a blank email to php-notes+get-60118@lists.php.net to get a copy of this message
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? ---- Manual Page -- http://www.php.net/manual/en/ref.xml.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37265 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37265&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37265&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60118) next »