Christian,
As always, thank you for your help! I had tried the following
```xquery
declare function local:grab2(
$url as xs:string,
$path as xs:string,
$fname as xs:string
) as document-node() {
let $req := http:send-request(, $url)
return
if (head($req)/@status = "200")
then fi
Hi Bridger,
As your query will either return an empty sequence (in the case of
success) or a string (in the case of an error), you’ll need to use
xs:string? as return type:
declare function local:grab(
$url as xs:string,
$path as xs:string,
$fname as xs:string
) as xs:string? {
...
Hope
And naturally I forgot to mention...
On Sun, Oct 11, 2020 at 3:49 PM Bridger Dyson-Smith
wrote:
> Hi all -
>
> I'm accustomed to writing something like the following:
>
> ```xquery
>
> declare function local:grab(
> $url as xs:string,
> $path as xs:string,
> $fname as xs:string
> ) as docum
Hi all -
I'm accustomed to writing something like the following:
```xquery
declare function local:grab(
$url as xs:string,
$path as xs:string,
$fname as xs:string
) as document-node() {
let $req := http:send-request(, $url)
return
if (head($req)/@status = "200")
then file:write
4 matches
Mail list logo