[xquery-talk] A doc()-map chain operator proposal

Benito van der Zander benito at benibela.de
Mon May 18 08:23:41 PDT 2015


Hi,
if you query data from deep websites, you almost always end up with a 
long get-link-download chain like:

doc("http://example.org") // a [ condition 1 ] / doc( @href) //a [ 
condition 2 ] / doc(@href) //a [ condition 3 ] / doc(@href) / ....

Half the query is a / doc( @href) filler.
It is really ugly, isn't it?

How about replacing / doc( @href) with a single map operator? (or more 
general / doc((@href, at src, at action)[1])

Like ~

Looks much better:

doc("http://example.org") // a [ condition 1 ] ~ //a [ condition 2 ] ~ 
//a [ condition 3 ] ~ / ....

Or !!

doc("http://example.org") // a [ condition 1 ] !! //a [ condition 2 ] !! 
//a [ condition 3 ] !! / ....

Does it not?



What do you think?

I guess the WG is not going to add it soon? Are any other ~ or !! 
operators planed?
Because it would be a shame to add it in an implementation, and then get 
XQuery 4, where there is a ~ operator that does something completely 
different.

Best,
Benito



More information about the talk mailing list