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 #7030

Tag function should expand XML_FastCreate objects

Details

Request #7030Tag function should expand XML_FastCreate objects
Submitted2006-03-06 11:29 UTC
Frombr at absb dot de
Assignedneokod
StatusClosed
PackageXML_FastCreate
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2006-03-06 11:29 UTC] br at absb dot de

Description:
------------
If you try to call the appended script constellation, the <z> tag contains the string "Object" instead of $fooxml's content.

Test script:
---------------
$fooxml = XML_FastCreate::factory('Text');

$fooxml->footag(
$fooxml->bartag('Hello World!'),
$fooxml->bartag('AYBABTU')
);

$barxml = XML_FastCreate::factory('Text');

$barxml->x(
$barxml->y('Blubb!'),
$barxml->z($fooxml)
);

$barxml->toXML();

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<x>
<y>Blubb!</y>
<z>
<footag>
<bartag>Hello World!</bartag>
<bartag>AYBABTU</bartag>
</footag>
</z>
</x>

Actual result:
--------------
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<x>
<y>Blubb!</y>
<z>Object</z>
</x>

[2006-03-06 11:48 UTC] neokod at php dot net

Thank you for taking the time to write to us, but this is not
a bug.

Hi,

This results is the expected behavior.
To do what's your want, you can uses the toXML() method :
$barxml->z($fooxml->toXML())

But your way is a good idea, may be I'll implement this feature in the next version.

Thanks