Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Request #15467 CDATA sections and blank nodes
Submitted: 2008-12-31 03:35 UTC
From: mprowler Assigned:
Status: Open Package: XML_Util (version 1.2.1)
PHP Version: 5.2.8 OS: Linux 2.6.26
Roadmaps: 1.3.0a1    

 [2008-12-31 03:35 UTC] mprowler (Joshua Ecklund)
Description: ------------ I am using the XML_Serializer package to output XML data to an Adobe Flex 3 application, and have CDATA sections turned on. However, when processing a blank string, XML_Util outputs a self-closing node (i.e. <node/>). I'm sure this is most likely the correct behavior, however Flex's XML handling will not utilize CDATA sections unless they are in the original XML. For this purpose, it would be great to have an option to always output CDATA sections regardless of the value being empty. To accomplish this for now, I have modified XML/Util.php, line 654, to read: if ($replaceEntities!=XML_UTIL_CDATA_SECTION && (!isset($tag['content']) || (string)$tag['content'] == '')) { Again, it would be great to have an option for this (which could then be added to XML_Serializer) in case it's needed by someone else in the future.