Database Reference
In-Depth Information
</exist:result>
</httpclient:body>
</httpclient:response>
The major part of the output is generated by the
httpclient:post
function. For the
result of our extended query
POST
request, look at the contents of the
httpclient:body
element. Notice that since the request returns a sequence and we
specified a start position and length of
3
, we get the third through fifth elements of
the sequence only.
Extended query request XML format
An extended query request has the following format:
<query xmlns = "http://exist.sourceforge.net/NS/exist"
start? = integer
max? = integer
cache? = "yes" | "no"
session-id? = string >
text
properties?
</query>
•
start
contains the index (counting from 1) of the first item to be returned.
•
max
is the maximum number of items to return. Together with
start
, it allows
you to control which part of the results you'll see.
• Setting
cache
to
yes
will have the query start a session. The session ID will be
returned in the result (in the
exist:session
attribute on the
exist:result
ele‐
ment) and must be passed in the
session-id
attribute on subsequent requests.
•
session-id
allows you to pass a previously created session identifier.
The
text
element is used to pass the query. You will most likely want to enclose its
contents in a
CDATA
section (
<text><<![CDATA[ ... ]]></text>
) to avoid XML
parsing errors.
The
properties
element can be used to set serialization properties like indenting and
character encoding:
<properties>
<property name = string
value = string >*
</properties>
A list of serialization properties can be found in
“Serialization Options” on page 119
.
Search WWH ::
Custom Search