Re: Hi, how to limit the duration of an XSLT transformation ?

Alexandre Bique <[email protected]>
Newsgroups gmane.comp.gnome.lib.xslt
Message-ID <[email protected]>
On Wed, Jan 12, 2011 at 11:03 AM, Alexandre Bique
<[email protected]> wrote:
>
> On Wed, Jan 12, 2011 at 2:23 AM, Michael Ludwig <[email protected]> wrote:
>>
>> Alexandre Bique schrieb am 11.01.2011 um 18:09 (+0100):
>> >
>> > I would like to limit the duration of xsltApplyStylesheet(), because
>> > some scripts take too much time and I have no control on it.
>>
>> If you have the power to abort the transformation (maybe using "alarm"
>> or a similarly brutish approach), you should also have the power to
>> prevent it in the first place, shouldn't you.
>
> Hi Michael,
>
> Sorry but I can't prevent the execution of an XSL script, because I can't tell if a script is slow or fast before executing it. Once I executed it, I can remember it's performances.
>
> I don't understand how to abort the transformation and if it can be safe? How do I cancel a running xsl transformation ? Is there public/private API like xsltAbortTransformation() ? How can I be sure that the current stack and all the context allocated memory will be freed ?

I looked into the API, and I found:
 - the field xsltTransformContext { ...; xsltTransformState	state;
...; } can be set to XSLT_STATE_STOPPED
 - the macro CHECK_STOPPED* which should be used in libxslt code to
check if the execution should be stopped.
So I should able to stop xsl transformation by changing the state to
XSLT_STATE_STOPPED right ?

Thanks.

--
Alexandre Bique
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
http://mail.gnome.org/mailman/listinfo/xslt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.