=Retrieval=
==db:text==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:text|$db as xs:string, $string as item()|text()*}}
|-
| '''Summary'''
|Returns all text nodes of the database specified by the database {{Code|$db}} that have {{Code|$string}} as their string value. If available, the value index is used to speed up evaluation.
|-
| '''Examples'''
|
* {{Code|db:text("DB", "QUERY")/..}} returns the parents of all text nodes of the database {{Code|DB}} that match the string {{Code|QUERY}}.
|}
==db:text-range==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:text-range|$db as xs:string, $min as xs:string, $max as xs:string|text()*}}
|-
| '''Summary'''
|Returns all text nodes of the database specified by the database {{Code|$db}} that are located in between the {{Code|$min}} and {{Code|$max}} strings. If available, the value index is used to speed up evaluation.
|-
| '''Examples'''
|
* {{Code|db:text-range("DB", "2000", "2001")}} returns all text nodes of the database {{Code|DB}} that are found in between {{Code|2000}} and {{Code|2001}}.
|}
==db:attribute==
|
* {{Code|db:fulltext("DB", "QUERY")}} returns all text nodes of the database {{Code|DB}} that contain the string {{Code|QUERY}}.
|}
==db:retrieve==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:retrieve|$db as xs:string, $path as xs:string|xs:base64Binary}}
|-
| '''Summary'''
|Returns a binary database resource addressed by the database {{Code|$db}} and {{Code|$path}} as [[Streaming Module|streamable]] {{Code|xs:base64Binary}}.
|-
| '''Errors'''
|{{Error|BXDB0003|#Errors}} the database is not ''persistent'' (stored on disk).<br/>{{Error|FODC0002|XQuery Errors#Functions Errors}} the addressed resource cannot be retrieved.<br/>{{Error|FODC0007|XQuery Errors#Functions Errors}} the specified path is invalid.
|-
| '''Examples'''
|
* {{Code|declare option output:method 'raw';<br/>db:retrieve("DB", "music/01.mp3")}} returns the specified audio file as raw data.
* <code><nowiki>stream:materialize(db:retrieve("DB", "music/01.mp3"))</nowiki></code> returns a materialized representation of the streamable result.
|}
|}
==db:retrievename== {{Mark|Added with Version 7.7}}:
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:retrievename|$db node as node()|xs:string, $path as xs:string|xs:base64Binary}}
|-
| '''Summary'''
|Returns a binary the name of the database resource addressed by in which the database {{Code|$db}} and {{Code|$path}} as specified [[Streaming Module#Database Nodes|streamabledatabase node]] {{Code|xs:base64Binary$node}}is stored.
|-
| '''Errors'''
|{{Error|BXDB0003BXDB0001|#Errors}} the database is not ''persistent'' (stored on disk).<br/>{{Error|FODC0002Code|XQuery Errors#Functions Errors$nodes}} the addressed resource cannot be retrieved.<br/>{{Error|FODC0007|XQuery Errors#Functions Errors}} the specified path contains a node which is invalid.|-| '''Examples'''|* {{Code|declare option output:method 'raw';<br/>db:retrieve("DB", "music/01.mp3")}} returns the specified audio file as raw data.* <code><nowiki>stream:materialize(db:retrieve("DB", "music/01.mp3"))</nowiki></code> returns not stored in a materialized representation of the streamable resultdatabase.
|}
==db:textpath=={| width='100%'|-| width='90' | '''Signatures'''|{{FuncMark|db:text|$db as xs:string, $string as item()|text()*Added with Version 7.7}}|-| '''Summary'''|Returns all text nodes of the database specified by the database {{Code|$db}} that have {{Code|$string}} as their string value. If available, the value index is used to speed up evaluation.|-| '''Examples'''|* {{Code|db:text("DB", "QUERY")/..}} returns the parents of all text nodes of the database {{Code|DB}} that match the string {{Code|QUERY}}.|}
==db:text-range==
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|db:text-rangepath|$db as xs:string, $min as xs:string, $max node as node()|xs:string|text()*}}
|-
| '''Summary'''
|Returns all text nodes the path of the database specified by the database {{Code|$db}} that are located document in between which the {{Codespecified [[#Database Nodes|$min}} and database node]] {{Code|$maxnode}} strings. If available, the value index is used to speed up evaluationstored.
|-
| '''ExamplesErrors'''|* {{CodeError|BXDB0001|db:text-range("DB", "2000", "2001")#Errors}} returns all text nodes of the database {{Code|DB$nodes}} that are found contains a node which is not stored in between {{Code|2000}} and {{Code|2001}}a database.
|}