Home » XML » XML_Util » Bug #8196
createTagFromArray sort toggle
Details
| Request #8196 | createTagFromArray sort toggle |
|---|---|
| Submitted | 2006-07-12 21:06 UTC |
| From | jhart at onyxraven dot com |
| Assigned | schst |
| Status | Closed |
| Package | XML_Util |
| PHP Version | 4.4.2 |
| OS | FreeBSD |
| Roadmaps | (Not assigned) |
Comments
[2006-07-12 21:06 UTC] jhart at onyxraven dot com
Description:
------------
Looking through CVS and the downloaded Stable source, it looks like createTagFromArray always sets the sort flag for the attributesToString method. This, and other sorting, should be able to be toggled from the method call.
(I've tracked this back from how XML_Serializer uses Util, tracking down where the sort is happening)
This is not a critical bug or anything, I just was suprised that though other options like multiline were able to be configured on the FromArray method, that sorting was not.
Test script:
---------------
include_once 'XML/Util.php';
$tag = array(
'qname' => 'tag',
'attributes' => array(
'c' => 'one',
'b' => 'two',
'a' => 'three',
),
);
//assume second parameter is sort flag (as it is in attributesToString
$xmltag = XML_Util::createTagFromArray($tag, false);
print_r($xmltag);
Expected result:
----------------
<tag c="one" b="two" a="three" />
Actual result:
--------------
//second sort flag isn't currently implemented
<tag a="three" b="two" c="one" />