On 3/13/06, Rafael Guédez <
[EMAIL PROTECTED]> wrote:
Hi, reading the class I think the problem is in the line 135:var obj = p_parentObject[nodeName] = p_allArray ? [] : {};You are overwriting the same child object every time, if you see the original code you need to create an array to put inside all the childs with the same nodeName.regardsRafaelOn Mar 13, 2006, at 5:52 PM, Rafael Guédez wrote:Hi John,I'm testing out your class and I can't get it to work properly, I only get the last node of my xml when try to convert it to object. For example this xml structure:<ROOT><SEC><SUB>123</SUB></SEC><SEC><SUB>456</SUB></SEC><SEC><SUB>789</SUB></SEC></ROOT>Using LumincBox log to trace the object I get only:*INFO*:myLogger:(object) {ROOT:(object) {SEC:(object) {SUB:789}}}And with the old XML2Object from Alessandro I get it fine:*INFO*:myLogger:(object) {ROOT:(object) {SEC:(array) {2:(object) {SUB:(object)data:(null)attributes:(object)}1:(object) {SUB:(object)data:(null)attributes:(object)}0:(object) {SUB:(object)data:(null)attributes:(object)}}data:(null)attributes:(object)}}*LuminicBox dont trace the complete deep of the object, but the nexts objects are there.I'm doing something wrong or is a error in the class?regardsRafaelOn Mar 3, 2006, at 3:18 PM, John Grden wrote:Sorry sorry, I found an issue with the xml to object where it was returning "string" as the value rather than the actual value.
it's fixed at revision 110
http://mirror1.cvsdude.com/trac/osflash/xray/browser/downloads/FLASC/XMLObject.asOn 3/3/06, John Grden < [EMAIL PROTECTED] > wrote:Ok, well, i've successfully rewritten the entire class ;)
* No longer extends XML
* Changed to a static class
* changed package to org.opensourceflash.data since it's been completely rewritten
* wrote new convertToObject method for converting XML to Object
* added cleanObject so that the pure object is sent back without the root node/object reference
* included a new addStrings() method to add new replacement values for any other charatcters you wish to encode when going from Object to XML
i've put it into Flasc for the import/export and it's working great so far. Would love to have other's give it a whirl and let me know what they think.
--
John Grden - Blitz_______________________________________________osflash mailing list_______________________________________________osflash mailing list
_______________________________________________
osflash mailing list
osflash@osflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org
--
John Grden - Blitz
_______________________________________________ osflash mailing list osflash@osflash.org http://osflash.org/mailman/listinfo/osflash_osflash.org