Changes

Jump to navigation Jump to search
144 bytes removed ,  18:38, 1 December 2023
m
Text replacement - "syntaxhighlight" to "pre"
Since BaseX 10, results in the {{Code|rest}} namespace are returned unprefixed:
<syntaxhighlight pre lang="xml">
<!-- before -->
<rest:databases xmlns:rest="http://basex.org/rest"/>
:<code>http://localhost:8080/rest</code>
<syntaxhighlight pre lang="xml">
<databases xmlns="http://basex.org/rest">
<database resources="25742" size="43813599">articles</database>
:<code>http://localhost:8080/rest/articles</code>
<syntaxhighlight pre lang="xml">
<database name="articles" xmlns="http://basex.org/rest">
<dir>binaries</dir>
Create an empty database and return database information:
<syntaxhighlight pre lang="xml">
<commands>
<create-db name='db'/>
Return the first five city names of the <b>factbook</b> database:
<syntaxhighlight pre lang="xml">
<rest xmlns="http://basex.org/rest">
<rest><![CDATA[ (//city/name)[position() <= 5] ]]></text>
Return string lengths of all text nodes that are found in the node that has been specified as initial context node:
<syntaxhighlight pre lang="xml">
<query>
<text>for $i in .//text() return string-length($i)</text>
Return the registered database users encoded in <code>ISO-8859-1</code>:
<syntaxhighlight pre lang="xml">
<command>
<text>show users</text>
Create a new database from the specified input and preserve all whitespaces:
<syntaxhighlight pre lang="xml">
<command>
<text>create db test http://files.basex.org/xml/xmark.xml</text>
Bind value to the {{Code|$person}} variable and run query <code>find-person.xq</code>:
<syntaxhighlight pre lang="xml">
<run>
<variable name='person' value='Johannes Müller'/>
If <code>query</code> or <code>run</code> is used as an operation, external variables can be specified via the <code><variable/></code> element:
<syntaxhighlight pre lang="xml">
<query xmlns="http://basex.org/rest">
<text><![CDATA[
<code>org.basex.util.Base64</code> can be used for that purpose:
<syntaxhighlight pre lang="java">
import java.net.*;
import org.basex.util.*;
the connection (in this example we explicitly store the input file as raw):
<syntaxhighlight pre lang="java">
// store input as raw
conn.setRequestProperty("Content-Type", "application/octet-stream");
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu