我正在尝试使用Altova XMLSpy中内置的XQuery编译器通过XQuery删除XML节点。
xquery version "1.0" encoding "UTF-8";
for $customer in doc("Customers.xml")/dataroot/Customers
where $customer/CustomerID = "ALFKI"
return delete node $customer;问题是编译器没有将'delete node‘视为有效语法,而它的定义如下:http://www.w3.org/TR/xquery-update-10/
它报告错误“意外的令牌节点$customer”。
有什么想法吗?
发布于 2013-04-15 00:33:54
删除$customer后面错位的分号。
xquery version "1.0" encoding "UTF-8";
for $customer in doc("Customers.xml")/dataroot/Customers
where $customer/CustomerID = "ALFKI"
return delete node $customer (: here was the semicolon :)否则,您的XQuery有效。
发布于 2013-08-28 21:28:58
事实是,XMLSpy不支持XQuery更新工具,因此delete关键字无效
https://stackoverflow.com/questions/15998593
复制相似问题