QXmlQuery
Unsolved
General and Desktop
-
Hello,
I would like to know if it is possible to insert/modify/remove data with an XQuery using QXmlQuery?
I found an "exemple":http://www.xmlmind.com/tutorials/XQueryUpdate/index.html of XQuery updating some data with the following query but I am not able to run it:
for $idattr in doc("data.xml")//ITEM/@Id (: selection :) return ( delete node $idattr, (: update 1 :) insert node <NID>{string($idattr)}</NID> (: update 2 :) as first into $idattr/.. )
I have the following error :
syntax error, unexpected node, expecting )If it is not possible to use insert or delete how I am suppose to modify the content of a document?
Thanks
Lee! -
Hi and welcome to devnet,
I don't think it's implemented. You can use the QXmlStreamReader/Writer classes to read modify/write or QDomDocument.