Discussion:
[xquery-talk] simple map at the moment is not so simple
Ihe Onwuka
2014-03-04 15:13:37 UTC
Permalink
I have something like

distinct-values(somepath/@x) !
http:send-request(<http:request href="'http://www.me.com/' || . "
method ="get"/>

which works fine

I now want to find out the @x's for which the http request fails which
entails checking the status attribute of the first sequential item
returned from the send-request (thats not the problem I already know
how to do that).

Now i thought you could flowr the right hand side of the map operator
which would allow me to variablize the output of the http request and
interrogate that. However as soon as it sees the $ in let $ following
the ! operator it objects (well eXist does anyway).

I'm using or trying to use ! because the iteration of it's right hand
side is not over nodes. Not clear on exactly what can and can't follow
!.

So to summarize I want to output the LHS (@x) of the simple map
expression where the http request in the RHS has not worked (i.e
http:send-request()[1]/@status ne 200).
Michael Kay
2014-03-04 15:28:27 UTC
Permalink
Show us the failing expression. I suspect the expression on the RHS of "!" should be in parens.

Michael Kay
Saxonica
Post by Ihe Onwuka
I have something like
http:send-request(<http:request href="'http://www.me.com/' || . "
method ="get"/>
which works fine
entails checking the status attribute of the first sequential item
returned from the send-request (thats not the problem I already know
how to do that).
Now i thought you could flowr the right hand side of the map operator
which would allow me to variablize the output of the http request and
interrogate that. However as soon as it sees the $ in let $ following
the ! operator it objects (well eXist does anyway).
I'm using or trying to use ! because the iteration of it's right hand
side is not over nodes. Not clear on exactly what can and can't follow
!.
expression where the http request in the RHS has not worked (i.e
_______________________________________________
http://x-query.com/mailman/listinfo/talk
Ihe Onwuka
2014-03-04 16:32:14 UTC
Permalink
Away from my machine at the mo but I can tell you it isn't. I'm sure
I've fallen for that one before.
Post by Michael Kay
Show us the failing expression. I suspect the expression on the RHS of "!" should be in parens.
Michael Kay
Saxonica
Post by Ihe Onwuka
I have something like
http:send-request(<http:request href="'http://www.me.com/' || . "
method ="get"/>
which works fine
entails checking the status attribute of the first sequential item
returned from the send-request (thats not the problem I already know
how to do that).
Now i thought you could flowr the right hand side of the map operator
which would allow me to variablize the output of the http request and
interrogate that. However as soon as it sees the $ in let $ following
the ! operator it objects (well eXist does anyway).
I'm using or trying to use ! because the iteration of it's right hand
side is not over nodes. Not clear on exactly what can and can't follow
!.
expression where the http request in the RHS has not worked (i.e
_______________________________________________
http://x-query.com/mailman/listinfo/talk
Loading...