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_Serializer » Bug #8048

Entities are not replaced in tags with attributes

Details

Submitted2006-06-28 07:41 UTC
Frompear at coworld dot net
Assignedschst
StatusClosed
PackageXML_Serializer
PHP Version4.3.9
OSMandrake 9.1
Roadmaps0.19.0a1

Comments

[2006-06-28 07:41 UTC] pear at coworld dot net

Description:
------------
Entities are not replaced in tags which contains attributes. The XML result is invalid.

Test script:
---------------
options = array(
"indent" => " ",
"linebreak" => "\n",
"defaultTagName" => "unnamedItem",
"scalarAsAttributes" => false,
"attributesArray" => '_attributes',
"contentName" => '_content'
);

$data = array(
'foo' => array(
'_attributes' => array( 'version' => '1.0', 'foo' => 'bar' ),
'_content' => 'test & test'
),
'schst' => 'Stephan & Schmidt'
);

$serializer = new XML_Serializer($options);
$result = $serializer->serialize($data);
$xml = $serializer->getSerializedData();

Expected result:
----------------
<array>
<foo foo="bar" version="1.0">test & test</foo>
<schst>Stephan & Schmidt</schst>
</array>

Actual result:
--------------
<array>
<foo foo="bar" version="1.0">test & test</foo>
<schst>Stephan & Schmidt</schst>
</array>