PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Configuration » Config » Bug #2014

use CDATA

Details

Request #2014use CDATA
Submitted2004-07-29 13:56 UTC
Fromstephan at wentz dot it
Assignedmansion
StatusClosed
PackageConfig
PHP Version4.3.7
OSLinux
Roadmaps(Not assigned)

Comments

[2004-07-29 13:56 UTC] stephan at wentz dot it

Description:
------------
I wanted all my data to be written as CDATA, but this isn't implemented in Config.

I edited Config/Container/XML.php on line 200 from this:

$string .= $indent.XML_Util::createTag($obj->name, $attributes, $obj->content);

to this:

$string .= $indent.XML_Util::createTag($obj->name, $attributes, $obj->content, null, XML_UTIL_CDATA_SECTION);

Reproduce code:
---------------
-

Expected result:
----------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<root>
<note1>
<date><![CDATA[07.07.04]]></date>
<name><![CDATA[test-name]]></name>
<content><![CDATA[test-content]]></content>
</note1>

</root>

Actual result:
--------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<root>
<note1>
<date>07.07.04</date>
<name>test-name</name>
<content>test-content</content>
</note1>

</root>

[2004-07-29 13:57 UTC] stephan at wentz dot it

Hmm this was of course a dumb idea ;-)

Don't change it, make it configurable. Would be greate to have a parameter that controls wether to use CDATA or not...

[2004-08-07 10:14 UTC] bmansion at mamasam dot com

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.

You can now specify whether you want CData or not through the boolean option 'useCData'.