From: Florent G. <li...@fg...> - 2011-08-24 16:04:26
|
Hi, I discovered what I think is a bug in the current trunk. Unfortunately, I was not able to reduce the reproduction sample more than the following (in particular, I couldn't get rid of the call to http:send-request()): import module namespace http = "http://expath.org/ns/http-client"; let $base := 'http://expath.org/modules/http-client/test/request' let $val := http:send-request( <http:request href="{ $base-uri }/headers-001" method="get"/>) return if ( $val/* ) then $val else '...' $val is a sequence of two nodes: first an element http:response (the parent of which being a document node), and second a document node with an element 'fail', returned from the web server. If you evaluate this code in the admin console, it returns the sequence in the other order (first the doc with 'fail', then http:response). Note that if you change "if ( $val/* )" into "if ( $val )", the result is correct. As far as I know, the processor is not entitled to change the order of the sequence here... Any idea? I couldn't investigate any further. Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ |