我试图使用以下XQuery (在eXide中)更新XML文件中的节点:
xquery version "3.0";
let $update := doc('db/apps/xmlFiles/Customers.xml')//Customers[ID = 6]
return replace value of node $update/LastName with 'Morris'但是,我收到了这个错误,它阻止了我运行查询:
在执行表达式时发现错误: org.exist.xquery.XPathException: err: line 0003意外令牌:值在第4行第16列
有人知道这会有什么问题吗?如有任何帮助和建议,将不胜感激。
发布于 2015-03-09 12:25:42
正如@dirkk所提到的,eXist不支持XQUF1.0,而是实现了XQUF的早期草案版本。但是,您仍然可以使用此代码执行您想做的事情:
xquery version "3.0";
let $update := doc('db/apps/xmlFiles/Customers.xml')//Customers[ID = 6]
return
update value $update/LastName with 'Morris'注意,在eXist中,更新将立即应用于数据库中的节点,而不是XQUF1.0,后者创建了PUL (挂起更新列表),然后在查询完成时应用。
https://stackoverflow.com/questions/28905897
复制相似问题