Thanks Rich,
Works like a charm.
Based on this I even succeeded in passing a number of required
'ancestor'-names.
Thamks!
Willem van den Goorbergh
Op 5-sep-2007, om 12:56 heeft Rich Shupe het volgende geschreven:
Here are two quick ways of doing it, depending on whether you want
child
nodes or the element itself. Both are shown in the trace so you can
experiment and modify this to suit your needs.
var myXML:XML = <ANIMALS>
<MAMMALS>
<MAMMAL>human</MAMMAL>
<MAMMAL>cow</MAMMAL>
<MAMMAL>dog</MAMMAL>
</MAMMALS>
<BIRDS>
<BIRD>blackbird</BIRD>
<BIRD>dove</BIRD>
<BIRD>
<BIRDIE>test</BIRDIE>
</BIRD>
</BIRDS>
<FISHES>
<FISH>fishAndChips</FISH>
<FISH>goldfish</FISH>
<FISH>herring</FISH>
<FISH>shark</FISH>
<MAMMAL>whale</MAMMAL>
</FISHES>
</ANIMALS>;
function traceNode (xmlObj:XML, nodeName:String):void {
for each (var element:XML in xmlObj..*) {
if (element.name() == nodeName) {
trace(element);
}
}
trace("--");
trace(xmlObj..*.(name() == nodeName));
}
traceNode(myXML, "FISH");
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Geografiek is a Dutch, Utrecht-based map and chart design company.
Willem van den Goorbergh can be contacted by telephone: (+31)
30-2719512 or cell phone: (+31)6-26372378
or by fax: (+31)302719687
snail mail: Hooghiemstraplein 89 3514 AX UTRECHT
Visit our website at: http://www.geografiek.nl
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com