On Fri, 2009-08-14 at 14:20 +0200, Daniel Veillard wrote:
Actually I think there is a nicer way to do this, by never
registering any global extensions, just registering the functions
on the transformation context. This mean you just call xsltInit()
from the initialization routine, and forget about any global
registration altogether, no need to add pthread specific changes
either, see patch attached. It also take care of one of your
TODOs i.e detect XSLT failures, you should just check that
return values from apply_stylesheet() are not NULL (left TODO).
Excellent; I just committed your patch wit a few minor changes to
improve error reporting and propagate errors with ERR_BAIL.
Oh another cleanup is that you should not call
xmlDocDumpFormatMemory() on an XSLT output document but use
one of the xsltSaveResultTo...() function which will handle
the xsl:output parameters from the stylesheet, in the case of
drv_xml_desc() use xsltSaveResultToString()
http://xmlsoft.org/XSLT/html/libxslt-xsltutils.html#xsltSaveResultToString
Ok .. I'll post a patch for that shortly.
int register_exts(xsltTransformContextPtr ctxt)
should be exported internally in some .h but I wasn't sure where you
would prefer to do this
I use internal.h as a catch-all for internal exports from files that
don't have a spearate .h.
thanks again for hte fix,
David