我在 Flex 中有一个应用程序,它从远程站点检索 XMLList(测试),假设通常包含 5 个孩子(测试),我用每个孩子循环遍历 XMLList 并做一些工作正常的图表。在一些奇怪的情况下,我在我的 XMList 中接收了多达 10 个孩子,我的应用程序选择使用最后 5 个,而正确的集合假设是前 5 个集合。如何只选择前 5 组而忽略最后一组?
<Tests count="10">
<Test unix_time="1378375047" client="25478955" id="831527">
<means>502</means>
<variance>56.3</variance>
<frequency>50</frequency>
</Test>
<Test unix_time="1378375047" client="25478955" id="831529">
<means>502</means>
<variance>56.3</variance>
<frequency>50</frequency>
</Test>
<Test unix_time="1378375047" client="25478955" id="831526">
<means>502</means>
<variance>56.3</variance>
<frequency>50</frequency>
</Test>
<Test unix_time="1378375047" client="25478955" id="831528">
<means>502</means>
<variance>56.3</variance>
<frequency>50</frequency>
</Test>
<Test unix_time="1378375047" client="25478955" id="831530">
<means>502</means>
<variance>56.3</variance>
<frequency>50</frequency>
</Test>
<Test unix_time="1378375200" client="25478955" id="831652">
<means>600</means>
<variance>44</variance>
<frequency>45</frequency>
</Test>
<Test unix_time="1378375200" client="25478955" id="831654">
<means>600</means>
<variance>44</variance>
<frequency>45</frequency>
</Test>
<Test unix_time="1378375200" client="25478955" id="831651">
<means>600</means>
<variance>44</variance>
<frequency>45</frequency>
</Test>
<Test unix_time="1378375200" client="25478955" id="831653">
<means>600</means>
<variance>44</variance>
<frequency>45</frequency>
</Test>
<Test unix_time="1378375200" client="25478955" id="831655">
<means>600</means>
<variance>44</variance>
<frequency>45</frequency>
</Test>
</Tests>