1

来自food:food-item($food:fps-photo-atlas) 的XML 文件结果

<portion>
<food-description unit="g">Spaghetti     </food-description>
<food-number file-type="jpg">3    </food-number>
<portion-size>
<size tag="1">55    </size>
<size tag="2">108    </size>
<size tag="3">161    </size>
<size tag="4">214    </size>
<size tag="5">266    </size>
<size tag="6">319    </size>
<size tag="7">372    </size>
<size tag="8">425    </size>
</portion-size>
<size-increment eight-plus="478">52.86    </size-increment>
</portion>

我的 XQUERY(XML 到 HTML 部分)

for $x in food:food-item($food:fps-photo-atlas)/portion/portion-size
return
<i>{data($x/size)}</i>
}

当前 XQuery 的当前结果

<i>55 108 161 214 266 319 372 425</i>

首选结果..

<i>55</i>
<i>108</i>
<i>161</i>
<i>214</i>
<i>266</i>
<i>319</i>
<i>372</i>
<i>425</i>

谢谢!

4

1 回答 1

3
for $x in food:food-item($food:fps-photo-atlas)/portion/portion-size/size
return
<i>{data($x)}</i>
}
于 2012-05-05T01:58:30.570 回答