Christian, thanks. In fact this path expression work in the context of XQuery code. http:send-request(...)[2] But using the CLI with an xml with two elements give me an error $ echo "<a></a><b></b>" | java -cp basex.jar org.basex.BaseX -i - -q".[2]" "1339078766196.xml" (Line 1): No elements allowed after closed root element. I have the error even when I use the -i option with an xml file having two elements. My intention was to save the http:send-request output to a file and process it later with a CLI. Is it the intented behavior of the CLI? On Wed, Jun 6, 2012 at 6:20 AM, Christian Grün <christian.gruen@gmail.com> wrote:
I'm using the HTTP Module[1] for sending request. The response has he http:response element which is XML. Then at the end of that element is the body of the response.
http:send-request() will return two items. You can access the second one (the actual result) with a positional predicate:
http:send-request(...)[2]