Re: [xml] Timeout of external xslt document request
- From: Rob Richards <rrichards ctindustries net>
- To: Joel Dubien <joel booyahnetworks com>
- Cc: xml gnome org
- Subject: Re: [xml] Timeout of external xslt document request
- Date: Sat, 01 Mar 2008 14:10:52 -0500
Hi Joel,
Can you send me your script? It does work, personally just tested it
again, so there might be some other issue.
This is not a libxml2/libxslt issue, but rather PHP specific, so I would
suggest taking this off this mailing list. If you want to keep this on a
mailing list, feel free to post your script and issue on the php.xml list.
Rob
Joel Dubien wrote:
Rob,
It sounded all good, but when I tried this out, it doesn't seem to be
working.
Here is my code:
$docPageXSL->load($strXSLFile);
$oProcessor->importStylesheet($docPageXSL);
$aOpts = array(
"http" => array(
"timeout" => 5.0
)
);
$oContext = stream_context_create($aOpts);
libxml_set_streams_context($oContext);
// Transform the document
$docRenderedPage = $oProcessor->transformToDoc($docParams);
In the xsl I'm doing a
<xsl:variable name="bad" select="document('http://192.168.254.254')"/>
And it takes more like 60 seconds to time out.
Any other suggestions?
-----Original Message-----
From: Rob Richards [mailto:rrichards ctindustries net]
Sent: Thursday, February 28, 2008 3:30 PM
To: Joel Dubien
Cc: xml gnome org
Subject: Re: [xml] Timeout of external xslt document request
Joel Dubien wrote:
Hello,
I'm using libxslt with php, and I am doing a document call on an rss
feed that is not hosted by my server. I am worried that there maybe a
time when the rss feed is not responding and my site will suffer with
a
long loading time.
Is there anyway to change the timeout value of that document call? It
is
currently taking around 60 seconds to timeout, and I would like to
reduce that to 5 seconds.
PHP streams are used to handle I/O, so you have full control over all of
that.
You should read up on stream usage:
http://www.php.net/manual/en/ref.stream.php
as well as how to set the context when working with XML:
http://www.php.net/manual/en/function.libxml-set-streams-context.php
Rob
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]