我想问一下如何使用符号'question'获取节点XML的数量......
如果我有一些像这样的xml数据:
<?xml version='1.0' encoding='utf-8'?>
<questioner>
<question>
<id>001</id>
<content>soal 1</content>
<answer>a</answer>
</question>
<question>
<id>002</id>
<content>soal 2</content>
<answer>a</answer>
</question>
<question>
<id>003</id>
<content>soal 3</content>
<answer>a</answer>
</question>
<question>
<id>004</id>
<content>soal 4</content>
<answer>a</answer>
</question>
</questioners>
答案 0 :(得分:0)
var xml:XML = ... //init xml
var questionList:XMLList = xml.elements("question");
questionList.length // question count
这不是特定于AIR的,Flash在任何地方都具有XML功能。