PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_Beautifier » Bug #5450

Parser strip many tags

Details

Submitted2005-09-19 05:42 UTC
Fromjonysk at gmail dot com
StatusVerified
PackageXML_Beautifier
PHP Version5.0.3
OSDebian Linux
Roadmaps(Not assigned)

Comments

[2005-09-19 05:42 UTC] jonysk at gmail dot com

Description:
------------
This class is very useful for indent codes... But, unfortunately, many relevant tags are stripped, such as CDATA sections and DOCTYPE definition. This make the class useless for complex codes that have those features...

Test script:
---------------
A little example:

$string = "<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE bookmark SYSTEM \"bookmark.dtd\"><bookmark><category><![CDATA[ this cdata will be stripped ]]></category></bookmark>";

$xml_b = new XML_Beautifier();
if (Error::isError($a = $xml_b->formatString($string))) {
echo $a->getMessage();
} else {
echo $a;
}

Expected result:
----------------
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE bookmark SYSTEM "bookmark.dtd">
<bookmark>
<category>
<![CDATA[ this cdata will be stripped ]]>
</category>
</bookmark>

Actual result:
--------------
<bookmark>
<category>
this cdata will be stripped
</category>
</bookmark>