我想选择<NewsData>
<NewsPhoto>
女王[iType='Photo']"
<NewsData>
<NewsPhoto [iType='Photo']"></NewsPhoto>
</NewsData>
<NewsData>
<NewsPhoto></NewsPhoto>
</NewsData>
<NewsData>
<NewsPhoto [iType='Photo']"></NewsPhoto>
</NewsData>...
XML
FilterItem
我使用Jquery过滤器,但 var FilterItem = $(xml).find('NewsData').filter(function(){
if($(this).children("NewsPhoto").attr('iType')=='Photo'){
return this;
}
});
console.log(FilterItem);
很难使用。
runtime: nodejs
env: flex
resources:
cpu: 1
memory_gb: 1
disk_size_gb: 20
handlers:
- url: /api
secure: always
script: app.js
- url: /
secure: always
static_dir: public
答案 0 :(得分:0)
试试这个,
$(xml).find("NewsData NewsPhoto[iType='Photo']")