Figaro - The XML Database for the .NET Framework
Copy
CopyXML
then that document becomes:
CopyXML
You can create a function that performs an update, so long as it is declared to be an updating function. In addition, this function must not have a return value, and the argument passed to the function cannot be an update query.
For example, the following query creates a function that renames any element node passed to it, to the value passed in the second argument. The function is then called for b1 in document mydoc.xml, which is stored in container con.dbxml:
local:renameNode($elem as element(),
$rep as xs:string)
{
rename node $elem as $rep
};
local:renameNode(doc("dbxml:/con.dbxml/mydoc.xml")/a/b1, "aab1")If the prior query is called on a document such as this:
<a> <b1>first child</b1> <b2>second child</b2> <b3>third child</b3> </a>
<a> <aab1>first child</aab1> <b2>second child</b2> <b3>third child</b3> </a>