Changes

Jump to navigation Jump to search
560 bytes added ,  13:32, 26 May 2013
no edit summary
| <code>\4 {id}</code>
| <code>\x {item} ... \x {item} \0</code>
| Returns all resulting items as strings, prefixed by a single byte ({{Code|\x}}) that represents the [[Server Protocol: Types|Type ID]]. This command will usually be called by the {{Code|more()}} function of a client implementation.
|-
| EXECUTE
| <code>\31 {id}</code>
| <code>''XDM'' {item} ... ''XDM'' {item} \0</code>
| Returns all resulting items as strings, prefixed by the [[Server Protocol: Types#XDM Meta Data|XDM Meta Data]]. This command is e. g. used by the [[Developing|XQJ API]].
|}
All results end with a single {{Code|\0}} byte, which indicates that the process was successful. If an error occurs, a byte {{Code|\1}} is sent instead, followed by the {{Code|error message}}.
==Examples=Example=== In the following example, a client registers a new session and calls the {{Code|INFO}} command. Next, it creates a new XQuery {{Code|1, 2+'3'}}, which receives the id {Code|\1}. The query is then evaluated via the {{Code|RESULTS}} command, and the server returns the result of the first subexpression {{Code|1}} and an error for the second sub expression: * Client: {{Code|\4 \1 ==Existing Clients==
* [https://github.com/BaseXdb/basex-examples/blob/master/src/main/java/org/basex/examples/api/BaseXClient.java Java client]
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu