It sounds like you are asking why

 

    myXML.some-node

 

doesn't give you what you wan. The answer is that it is actually a subtraction:

 

    myXML.some - node

 

This isn't a bug; it's just how the . and - operators work in AS3 and E4X. When a node name isn't a legal AS3 identifier, you have to either write

 

    myXML["some-node"]

 

or

 

    myXML.elements("some-node")

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Carlos Rovira
Sent: Saturday, March 04, 2006 4:04 PM
To: [email protected]
Subject: [flexcoders] [AS3][E4X] Node access problem due to "-" char

 

Hi,

I was playing with the new AS3 E4X and trying to access the following kind of XML node:

<some-node>Hi!<some-node>

I can't access this kind of node due to the middle "-" char. This problem happens in old AS2 XML object too.
In both XML objects (old AS2 and new AS3) we can reach the node using the following notation (and not dot notation that will be the preferred way):

myXML["some-node"]

Some XML languajes out there use this kind of notation (with "-" inserted inside node names), so I suppose this is a bug in the way E4X (and old XML AS2 object) works or I'm missing something. Please tell me If I'm wrong.

If this is a bug, could we expect a fix in the next FP8.5 alpha or beta version?

Thanks.

C.





--
::| Carlos Rovira
::| http://www.carlosrovira.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to