本文介绍了xQuery 更新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的 xml
<book asin="0201100886"
created="128135928"
lastLookupTime="128135928">
<price>102.00</price>
<purchaseDate>2005-01-22</purchaseDate>
</book>
<book asin="0122513363" created="128135600" lastLookupTime="128136224">
<price>50.95</price>
<purchaseDate>2005-01-22</purchaseDate>
</book>
<book asin="0201441241"
created="128136896"
lastLookupTime="128136896">
<price>108.20</price>
<purchaseDate>2005-01-22</purchaseDate>
</book>
<book asin="0471250600"
created="128136896"
lastLookupTime="128136896">
<price>107.95</price>
<purchaseDate>2005-01-22</purchaseDate>
</book>
<book asin="0321193628"
created="128136896"
lastLookupTime="128136896">
<price>112.40</price>
</book>
我需要将所有图书价格更新 0.50 美分.我该怎么做?
I need to update all the books prices by 0.50 cents. How can I do this?
推荐答案
如果您正在寻找使用 XQuery 更新工具的解决方案:
If you are looking for a solution using XQuery Update Facility:
for $p in //price return
replace value of node $p with $p + 0.50
这篇关于xQuery 更新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!