如何将所有foo
标签重命名为baz
使用XQuery
如下?
FLWOR:
declare namespace map = "http://www.w3.org/2005/xpath-functions/map";
declare namespace array = "http://www.w3.org/2005/xpath-functions/array";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
for $x in /root
return rename node $x/root/foo as "baz"
示例文档:
<root>
<foo>bar</foo>
</root>
我正在寻找的输出:
<root>
<baz>bar</baz>
</root>
也可以看看:
http://xqueryfiddle.liberty-development.net/nc4P6y8
和:
它使用了一些不完全不同的东西..