Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.5

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 (version 1.1.1)
PHP Version: 4.4.2 OS: FreeBSD
Roadmaps: (Not assigned)    
Subscription  


 [2006-07-12 21:06 UTC] jhart at onyxraven dot com (Justin Hart)
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" />

Comments

 [2006-12-01 17:16 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!