Hi, When using my library, these lines of code inserts the XML in the testdatabase: Session.Add("Test.xml", "<root/>"); Session.Command("set mixupdates true"); Q_Object = Session.Query( "insert nodes (<Line_1 line='1'>Content 1</Line_1>, <Line_2 line='2'>Content 2</Line_2>) " "into doc('/TestCppClient/Test.xml')/root"); Q_Object -> Execute(); First problem solved! But a new problem was introduced. I use the 'Full' command to return the reslts from a query. Q_Object = Session.Query("'/TestCppClient/Test.xml'"); Q_Object -> Full(); cout << Session.getResultString(); ==.<Line_1 line="1">Content 1</Line_1> But when I inspect the response from the server when executing the query with the 'Full' command, I can see that it contains the following content: /TestCppClient/Test.xml�|<Line_1 line="1">Content 1</Line_1>| /TestCppClient/Test.xml�|<Line_2 line="2">Content 2</Line_2>||| The '|' are inserted by my debug_dump function. A second function splits the original vector of bytes into a vector of vector of bytes. The '/TestCppClient/Test.xml' parts are elements 0,2, .. of the splitted vector. |<Line_1 line="1">Content 1</Line_1>| is element 1. It will be no big problem to adjust my code to get the correct output. But I wonder if the result from the server is in accordance with the documentation for the client server protocol (XDM {item} ... XDM {item} \00). Is the byte in front of |<Line_1 the XDM metadata? Ben Op 10-05-2026 om 01:13 schreef Graydon Saunders via BaseX-Talk:
If you're trying to change the actual thing, isn't the syntax going to be
insert node <Line_1 line="1">Content 1</Line_1> into doc('/TestCppClient/Test.xml')/root
? If it's update (= do this in memory), I'd expect
return update {insert node <Line_1 line="1">Content 1</Line_1> into doc('/TestCppClient/Test.xml')/root }
because update always has expression braces for the change that gets applied as the update.
I also have the impression (https://docs.basex.org/main/Updates#update <https://docs.basex.org/main/Updates#update> doesn't quite say explicitly) that `update` has a LHS so the processor knows what to copy when it applies the in-memory updates.
-- Graydon