Hi,
I'm struggling with some E4X and hope you can help.
Here's my XML structure:
<xml>
<node type="bar">
<subnode id="4">
<subnode id="5"/>
</subnode>
<subnode id="6"/>
</node>
<node type="foo">
<subnode id="7">
<subnode id="8">
<subnode id="9"/>
</subnode>
</subnode>
<subnode id="10"/>
</node>
</xml>
As you can see there are multiple "nodes" which can have unlimited child levels of "subnode" elements.
What I want to do is find @type attribute of the "node" for any given "subnode", based on its @id attribute. For example, if I have an id of 9 then I want to return the type="foo" from above.
The E4X I have come up with, but which fails is:
xml.node.(subnode.(@id == '8')).@type
I can kind of see why it doesn't work. What would make more sense is the following but the syntax fails (in AS3):
xml.node.(..subnode.(@id == '8')).@type
Anybody?
Jake