PEAR is archived and read-only

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

Home » XML » XML_FastCreate » Bug #1367

XML tags are converted to lowercase

Details

Submitted2004-05-07 20:06 UTC
Frompatrick dot lambert at noggin dot com
Assignedneokod
StatusClosed
PackageXML_FastCreate
PHP Version4.3.4
OSSolaris 9
Roadmaps(Not assigned)

Comments

[2004-05-07 20:06 UTC] patrick dot lambert at noggin dot com

Description:
------------
Upper or mixed-case XML tags are converted to lowercase.

Reproduce code:
---------------
$x =& new XML_FastCreate_Text();

$x->outer(
$x->INNER('foo')
);

$x->toXML();

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<outer>
<INNER>foo</INNER></outer>

Actual result:
--------------
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<outer>
<inner>foo</inner></outer>

[2004-05-07 20:53 UTC] guillaume dot lecanu at online dot fr

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

The PHP overload system don't return the correct case of the method called.
I search a solution, but you can temporaly use the translation option to bypass this bug.

Ex:
$x =& new XML_FastCreate_Text(
array(
'translate' => array(
'inner' => array('INNER')
)
)
);
$x->outer(
$x->INNER('foo')
);
$x->toXML();

This exemple return the expected result.

[2004-05-11 13:18 UTC] guillaume dot lecanu at online dot fr

In PHP function/method names are case-insensitive, so they
all get auto-converted to lowercase.
Cf. : http://bugs.php.net/bug.php?id=21463

If you really need uppercase in XML you can use the translation option.

$x =& new XML_FastCreate_Text(
array(
'translate' => array(
'upper' => array('UPPER')
)
)
);
$x->UPPER()
$x->toXML();