Filtering data

Let's work with this xml:

<?xml version="1.0" encoding="UTF-8"?>
	<book id='0'>
            <title>Thus Spoke Zarathustra</title>
	    <author>Friedrich Nietzsche</author>
	<book id='1'>
	    <title>The Stranger</title>
	    <author>Albert Camus</author>
	<book id='2'>
	    <title>The Idiot</title>
	    <author>Fyodor Dostoyevsky/author>
	<book id='3'>

The double dot (..)

The double-dot operator works for any level of nesting, and not just direct children.

Filtering Node Values

var authorList:XMLList = ==  "Goethe");

Filtering Attribute Information

var bookList:XMLList = ==  "3").title;

More than one conditions

var bookList:XMLList = ==  "Goethe" && title ==  "Faust").title;

Finding node index

var nodeIndex:int = ==  "Goethe").childIndex();
trace(nodeIndex); // traces '3'

Learning Resources

Check this tutorial for more.

And this.

Post A Comment

Anti-Spam Quiz: