Changes

Jump to navigation Jump to search
324 bytes removed ,  16:13, 23 April 2011
no edit summary
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:system</b>() as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Lists information on the database system, including the database path and current database settings.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:list</b>() as xs:string*</code><br />
|-
| valign='top' | '''Summary'''
|Returns an <code>xs:string</code> sequence with the names of all databases.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:open</b>($name as xs:string) as document-node()*</code><br />
|-
| valign='top' | '''Summary'''
|Returns a sequence with all document nodes contained in the database specified by <code>$name</code>. The name of the database may be extended by a collection path.|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]<br /b>is raised if the database is not found.
|-
| valign='top' | '''Examples'''
|The expression * <code>db:open("docs")</code> returns all documents from the database named <code>docs</code>.<br />The expression * <code>db:open("docs/one")</code> returns all documents from the database named <code>docs</code> in the subpath <code>one</code>.<br />|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0003]]</b> is raised if the database is not found.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:open-pre</b>($name as xs:string, $pre as xs:integer) as node()</code><br />
|-
| valign='top' | '''Summary'''
|Opens the database specified by <code>$name</code> and returns the node with the specified <code>$pre</code> value.|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0004]]</b> is raised if the specified <code>$pre<br /code>value does not exist in the database.
|-
| valign='top' | '''Examples'''
|The expression * <code>db:open-pre("docs", 0)</code> returns the first database node from the database named <code>docs</code>.<br />|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0004]]</b> is raised if the specified <code>$pre</code> value does not exist in the database.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:open-id</b>($name as xs:string, $id as xs:integer) as node()</code><br />
|-
| valign='top' | '''Summary'''
|Opens the database specified by <code>$name</code> and returns the node with the specified <code>$id</code> value.<br />In contrast to the <i>pre</i> value, the <i>id</i> will remain valid after update operations.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0004]]</b> is raised if the specified <code>$id</code> does not exist in the database.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:node-pre</b>($nodes as node()*) as xs:integer*</code><br />
|-
| valign='top' | '''Summary'''
|Returns the <i>pre</i> values of all database nodes specified by <code>$nodes</code>. <i>pre</i> values are direct, internal pointers to database nodes, which might be changed by updates.<br />
|-
| valign='top' | '''Examples'''
|The expression * <code>db:node-pre(doc("input"))</code> returns <code>0</code> if the database <code>input</code> contains a single document.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:node-id</b>($nodes as node()*) as xs:integer*</code><br />
|-
| valign='top' | '''Summary'''
|Returns the <i>id</i> values of all database nodes specified by <code>$nodes</code>. <i>id</i> values are pointers to database nodes, which are not changed by updates.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:text</b>($string as item()) as text()*</code><br />
|-
| valign='top' | '''Summary'''
|Returns all text nodes from the text index that have <code>$string</code> as their string value.|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the index is not available.<br /><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node.
|-
| valign='top' | '''Examples'''
|The expression * <code>db:text("QUERY")</code> returns all text nodes of the currently opened database that match the string <code>QUERY</code>.<br />The expression * <code>db:open("DB")/db:text("QUERY")/..</code> returns the parents of all text nodes of the database <code>DB</code> that match the string <code>QUERY</code>.<br />|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the index is not available.<br /><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:attribute</b>($string as item()) as attribute()*</code><br /><code><b>db:attribute</b>($string as item(), $name as xs:string) as attribute()*</code><br />
|-
| valign='top' | '''Summary'''
|Returns all attribute nodes from the attribute index that have <code>$string</code> as their string value.<br />If <code>$name</code> is specified, the resulting attribute nodes are filtered by their attribute name.|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the index is not available.<br /><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node.
|-
| valign='top' | '''Examples'''
|The expression * <code>db:open("DB")/db:attribute("QUERY", "id")/..</code> returns the parents of all attribute nodes of the database <code>DB</code> that have <code>QUERY</code> as string value.<br />|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the index is not available.<br /><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:fulltext</b>($text as xs:string) as text()</code><br />
|-
| valign='top' | '''Summary'''
|Returns all text nodes from the full-text index that contain the string <code>$text</code>. The index full-text options are used for searching, i.e., if the index terms were stemmed, the search string will be stemmed as well.|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the index is not available.<br /><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node.
|-
| valign='top' | '''Examples'''
|The expression * <code>db:fulltext("QUERY")</code> returns all text nodes of the currently opened database that contain the string <code>QUERY</code>.<br />|-| valign='top' | '''Errors'''|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the index is not available.<br /><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node.<br />
|}
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:info</b>() as xs:string</code><br /><code><b>db:info</b>($type as xs:string) as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Returns information on the database that is referenced by the current context item.<br />If <code>$type</code> is specified, the function returns information on a database index. It must be one of the values <code>TEXT</code>, <code>ATTRIBUTE</code>, <code>FULLTEXT</code>, <code>PATH</code>, <code>TAG</code>, or <code>ATTNAME</code>.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0001]]</b> is raised if the specified index is not available.<br /><b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node.<br />
|}
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu