Hi,
Thanks a lot for your reply. Yes your suggestion did fix the issue. After some
more search on the google, I did find the issue as well. By default it assigns
the root node to the variable.
Related to this, I did find another issue related to this which is converting
an existing object to XML and then accessing it. when I convert an object, all
the object values are assigned as attributes of the root node.
Here is the sample code
class MyEvent {
var x:int;
var y:int;
}
var event1:MyEvent = new MyEvent(10, 10);
var xmlVar:XML = new XML(event1);
When I dump xmlVar, it looks like this [MyEvent x="10" y="10"] and if I try to
access it like this [EMAIL PROTECTED] or xmlVar.attribute("x"), I get the same
error saying syntax error. Howver if I manually create it using xml notation
like <event x="10" y="10" />, [EMAIL PROTECTED] works perfectly. I dont why it
puts "[" instead of "<" when an on object is converted. Any idea how to resolve
this issue?
Thanks a lot again!
--- On Wed, 8/20/08, gabriela.perry <[EMAIL PROTECTED]> wrote:
From: gabriela.perry <[EMAIL PROTECTED]>
Subject: [flexcoders] Re: can't get XML working -- please help
To: [email protected]
Date: Wednesday, August 20, 2008, 9:40 AM
Hi.
A call to the first node (the root) is not necessary.
Try tracing xmlVar.x instead.
Also check these rules for good XML writing at
http://www.w3school s.com/xml/ xml_dtd.asp
Hope it helps :0)