I am using E4X to bind some values from xml in flex 3.
There is a problem when xml tag’s (or attribute’s) name has special character in it: having xml content
var xml:XML = <tag>
<special-name att="val" />
</tag>
special-name could not be accessed using xml.special-name.@att because it is interpreted as subtraction, on the other hand using square bracket notation xml['special-name'].@att breaks binding chain.
Is there an elegant way to solve this (like special language syntax) without writing custom binding setters and listeners?
Would the
child()function of theXMLclass work for you in that situation? I can’t check it right now, butchild()returns anXMLListand that should work for binding.Alternatively, couldn’t you just replace all “problematic” node names (storing the original names in a Dictionary with the replacement names being the keys) and then do the binding, simply avoiding the issue altogether?