May
31
2008
Using E4X with XML in AS3
Posted by: Keith H in ActionScript 3, XML, tags: E4X Filtering, Regular Expressions, XMLThe XML examples represent a book in a library. However the book has several bookworms in it.
Using E4X we can find these bookworms.
<library> <book> <page id="one"/> <worm name="Eddy" /> <page id="two"/> <page id="three"> <worm name="Lisa"/> <worm name="Pete" /> </page> <page id="four"/> </book> </library>
There are some E4X operators and XML methods to help use do this when combined together:
.. Access all descendants of the XML object.
. Access a property of an Object or XML.
* Wildcard, match any part of the XML.
childIndex() Index number of an XML object relative to its parent node.
name() Name of the XML node.
Entries (RSS)