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_FastCreate » Bug #7897

can't create cdata

Details

Submitted2006-06-14 09:24 UTC
Fromneta-master at ywcafe dot net
StatusVerified
PackageXML_FastCreate
PHP Version4.4.2
OSLinux
Roadmaps(Not assigned)

Comments

[2006-06-14 09:24 UTC] neta-master at ywcafe dot net

Description:
------------
cdata method cant create correct cdata.

Test script:
---------------
<?php
require_once 'XML/FastCreate.php';
$x =& XML_FastCreate::factory('Text');
$x->root(
$x->cdata("foo<h1>bar</h1>foo")
);
$x->toXML();
?>

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<root><![CDATA[
foo<h1>bar</h1>foo
]]></root>

Actual result:
--------------
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<root>/*<![CDATA[*/
foo<h1>bar</h1>foo
/*]]>*/</root>