Reputation: 14425
I have a XML node with a -
(minus) character in it. How can I access this in ActionScript E4X symtax without the compiler recognising the character as a minus operator?
E.g.
XML
<page>
<about-page>yo</about-page>
</page>
ActionScript
this.contentXML..page.about-page.text()
Thanks, Ross
Upvotes: 0
Views: 453
Reputation: 46756
You should be able to use the square bracket notation for accessing the property:
this.contentXML.page['about-page'].text()
Both the dot and square bracket notation do essentially the same thing, that is looking up a property. The only difference here is that the dot notation is limited by the syntax of the language.
Upvotes: 3