xsl-list
[Top] [All Lists]

Re: [xsl] document () return values.

2010-08-09 12:30:11
On Mon, 9 Aug 2010 13:46:41 +0000 (GMT)
Florent Georges <lists(_at_)fgeorges(_dot_)org> wrote:

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,

Exactly what I wanted... or should I say,
what is perfect for a link checker!

Thanks Florent.

regards 



-- 

regards 

-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>