Re: [xsl] document () return values.

Subject: Re: [xsl] document () return values.
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Mon, 9 Aug 2010 13:46:41 +0000 (GMT)
Dave Pawson wrote:

> Would it be useful to you to be able to access the http
> returned status codes from the 'get'?

  I am not sure to understand the
complete requirements, but that's possible with the EXPath HTTP Client
<http://expath.org/modules/http-client>.  Something like:

    <xsl:import
href="http://expath.org/ns/http-client.xsl"/>

    ...
    <xsl:variable
name="req" as="element(http:request)">
       <http:request method="get"
href="{ $my-url }"/>
    </xsl:variable>
    <xsl:variable name="resp"
select="http:send-request($req)"/>
    <xsl:sequence select="
        if (
$resp[1]/xs:integer(@status) eq 200 ) then
          'Ok'
        else
error(...)"/>

  Regards,

-- 
Florent Georges
http://fgeorges.org/

Current Thread