现在有如下一个 xml 文件
如下:
<root act="getherobag" codes="1" errmsg="">
<gem aid="1" id="17886" num="2" name="木の宝箱" pic="img/gem/other
/bx1.gif" gemwseat="特殊" demo="
" />
<gem aid="2" id="17887" num="2" name
="鉄の宝箱" pic="img/gem/other/bx2.gif" gemwseat="特殊" demo="
" />
<gem aid="3" id="17888" num="2" name
="銀の宝箱" pic="img/gem/other/bx3.gif" gemwseat="特殊" demo="
" />
<gem aid="4" id="17893" num="1" name
="硫黄運搬車" pic="img/gem/other/lhc.gif" gemwseat="特殊" demo="
" />
<gem aid="15" id="0" num="0" name
="" pic="img/pic/emp.gif" gemwseat="" demo=""/>
<gem aid="16" id="0" num="0" name="" pic="img/pic/emp
.gif" gemwseat="" demo=""/>
<key wkey="2" ikey="2" akey="2" gkey="0" />
<body aid="1" id="0" pic="img/pic
/emp.gif" demo=""/>
<body aid="2" id="0" pic="img/pic/emp.gif" demo=""/>
<body aid="3" id="0" pic="img/pic/emp.gif" demo=""/>
</root>
我先要查询 gem 并且 aid等于2的gem
因为用过asp什么的代码要查找都是select的挺简单的,不过flex中稍微有点不一样啊,如果要查询所以的gem只要写 doc.gem 就可以确实是很方便啊
如果要查找根据属性时,可以使用 doc.gem.(@aid == '2') 虽然写法很奇怪啊,可是网上这样写的,我就自己试一下,可是不能用,真是很奇怪啊
我也查了官方的文档上也是这样的,就是不能用啊,我就调试看看了,可是调试不能计算,郁闷啊,以前用vs的时候很方便的,要使用什么方法
调试的时候运行一下就可以了,马上就知道这些方便能不能用了。
也不知道哪里出了问题,有空看来还要研究一下