XmlParseTest
/**
* Copyright RaptorClaw ( http://wonderfl.net/user/RaptorClaw )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/qXbI
*/
package {
import flash.text.TextField;
import flash.display.Sprite;
public class FlashTest extends Sprite {
private var _textfield:TextField;
public function FlashTest()
{
_textfield = new TextField();
addChild(_textfield);
testXml();
}
private function testXml():void
{
var xml:XML =
<data>
<thing attr1="a" attr2="b"> </thing>
<thing attr1="b" attr2="d"> </thing>
<thing attr2="g"> </thing>
</data>
_textfield.text = xml.thing.(attribute("attr1") == "a").attribute("attr2");
}
}
}