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



On Wed, Jan 12, 2011 at 11:03 AM, Alexandre Bique
<bique alexandre gmail com> wrote:
>
> On Wed, Jan 12, 2011 at 2:23 AM, Michael Ludwig <milu71 gmx de> 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]