let me know, I'll get it in there
On 3/14/06, Rafael Guédez <[EMAIL PROTECTED]> wrote:
Hi John,I see the advance, but now is a bit confuse heheh. You can see that the object lost the SUB node, the object must have the same structure like the original code in the example of my first message.regardsRafaelOn Mar 14, 2006, at 8:48 AM, John Grden wrote:Ok, if you'll give it another shot, please download the latest.
http://mirror1.cvsdude.com/trac/osflash/xray/browser/downloads/FLASC/XMLObject.as?rev=119&format=raw
with this code, it traces out just fine with Xray, and I added a second XML doc as a secondary test with non-array structures:
import org.opensourceflash.data.XMLObject;
var xmlDoc_0:XML = new XML("<ROOT><SEC><SUB>123</SUB></SEC><SEC><SUB>456</SUB></SEC><SEC><SUB>789</SUB></SEC></ROOT>");
var xmlDoc_1:XML = new XML("<child_0 title=\"john\" url="" &lt;&gt; String</stringTest><cdataTest>&lt;![CDATA[Test &lt;&gt; String]]&gt;</cdataTest>");
var obj_0 = XMLObject.getObject(xmlDoc_0, false);
var obj_1 = XMLObject.getObject(xmlDoc_1, false);
tt(obj_0);
tt(obj_1);
// traces
(30) [object Object]:
ROOT =
SEC = 123,456,789
2 = 789
1 = 456
0 = 123
123 = 123
456 = 456
789 = 789
(31) [object Object]:
cdataTest = <![CDATA[Test <> String]]>
stringTest = Test <> String
child_0 = [object Object]
url = ""> title = john
prop_0 = [object Object]
0 = xray
1 = red5
2 = flasc
prop_1 = true
prop_2 = 12On 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
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
--
John Grden - Blitz_______________________________________________osflash mailing list
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
--
John Grden - Blitz
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
