Re: [xslt] xsltApplyStylesheet not returning?



On Thu, Feb 13, 2003 at 11:36:13AM +0000, Matt Sergeant wrote:
> If a stylesheet causes an error (in my case it was a variable being used
> that never existed) xsltApplyStylesheet doesn't seem to return - is it
> doing a longjmp or something?
> 
> In LibXSLT.xs I have:
> 
>         xsltSetGenericDebugFunc(NULL, NULL);
>         real_dom = xsltApplyStylesheet(self, doc, xslt_params);
>         if (real_dom == NULL) {
>            // handle error
>         }
> 
> And it never gets to teh if() statement if there's an error. But it
> doesn't segfault - for some reason it's causing my method (implemented in
> perl XS) to just return, which causes perl's stack to be corrupt and I get
> a perl error.

  Well, if it was C code I would say you have a compiler error.
But it's apparently not C code. At the C level the function will return,
there is no longjmp or anything like that, unless this was added to
one of the extension callbacks. libxslt code is purely procedural.

> Any ideas what to look for? I tried setting/unsetting various error
> handler functions but I always get the same results, whether or not I'm
> printing out the error myself or letting libxslt do it.

  Can you gdb perl ? Put a breakpoint there, ask for next and see if
it stops. If not the function didn't returned, and that's a callback problem
breaking the control flow. If yes I would suspect the xs->C or xs->code
generator to have inserted something funky there.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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