Changes

Jump to navigation Jump to search
60 bytes added ,  13:20, 6 July 2023
==Database Nodes==
In BaseX, two internal representations exist for XML nodes.:
* XML fragments are generated by XQuery node constructors (<code><a/></code>, <code>element a {}</code>, etc.).
* 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]].
* Fragments are similar to DOM structures. They are create when XQuery node constructors are used (<code><a/></code>, <code>element a { }</code>, etc.).
Some operations Fragments require less memory for small XML structures, but database nodes are restricted to database more efficient for larger amounts of data. Fragments nodes, but you can convert XML fragments be converted to database nodes by applying an empty a [[XQuery_Update#updateMain-Memory Updates|main-memory update]] or [[XQuery_Update#transform|transform]] operation with an empty body to a node:
<syntaxhighlight lang="xquery">
let $xml := <xml>hello world</xml> update {}return db:node-id($xml/text())
</syntaxhighlight>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu