我有这部分代码:
<recipe>
{ for $r in doc("retete.xml")//recipe
return <rec title="{$r/title}">{
<item>{
for $r3 in doc("listaPreturi.xml")//produs
for $r2 in $r/ingredients/ingredient
where $r2/@name = $r3/@denumire
return <it>{$r3/pret * $r2/@amount / $r3/pret/@cantitate}</it>
}
</item>
}</rec>}
</recipe>
结果就是这个
<recipe>
<rec title="Pui la cuptor">
<item>
<it>1550</it>
<it>250</it>
</item>
</rec>
<rec title="Curcan la cuptor">
<item>
<it>1550</it>
<it>1889.9999999999998</it>
</item>
</rec>
</recipe>
如何为每个<it>
个<item>
添加相同的函数值?