Changes

Jump to navigation Jump to search
1 byte removed ,  23:07, 1 December 2023
In BaseX, two internal representations exist for XML nodes:
* 1. Database nodes are:** stored in a persistent database on disk;** nodes of a document that has been generated temporarily with {{Code|fn:doc}}, {{Code|fn:parse-xml}} and other functions; or** the result of a [[XQuery Update#Main-Memory Updates|main-memory update]].* 2. Fragments are similar to DOM structures. They are created when XQuery node constructors are used (<code><a/></code>, <code>element a { }</code>, etc.).
Fragments require less memory for small XML structures, but database nodes are more efficient for larger amounts of data. Fragments nodes can be converted to database nodes by applying a [[XQuery_Update#Main-Memory Updates|main-memory update]] with an empty body to a node:
|- valign="top"
| '''Summary'''
|Exports the specified {{Code|$database}} to the specified file {{Code|$path}}. Existing files will be overwritten.<br/>The {{Code|$options}} argument contains [[Serialization|serialization parameters]] (see [https://www.w3.org/TR/xpath-functions-31/#func-serialize fn:serialize()]).
|- valign="top"
| '''Errors'''
|
* {{Code|db:rename("DB", "docs/dir/doc.xml", "docs/dir/newdoc.xml")}} renames the resource {{Code|docs/dir/doc.xml}} to {{Code|docs/dir/newdoc.xml}} in the database {{Code|DB}}.
* {{Code|db:rename("DB", "docs/dir", "docs/newdir")}} moves all resources in the database {{Code|DB}} from {{Code|docs/dir}} to {{Code|docs/newdir}}.
|}
{| class="wikitable" width="100%"
! width="110"|Code
|Description
|- valign="top"
|{{Code|args}}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu