Re: [xslt] extension
- From: Daniel Veillard <veillard redhat com>
- To: xslt gnome org
- Subject: Re: [xslt] extension
- Date: Wed, 18 Feb 2004 05:47:02 -0500
On Wed, Feb 18, 2004 at 10:38:03AM +0000, Steve Little wrote:
> > > I suppose that I have to call some function in my main.
> >
> > exsltRegisterAll(); probably,
>
> On a related note, I've got a couple of extension function built into an
> extension module and they work nicely. (I'd like to say I found the
> documentation on how to write them really helpful, since there have been
> complaints about the docs lately.)
>
> I've added a call to xsltRegisterExtModule() to a modifed version of
> xsltproc (just after the exsltRegisterAll() ) so that I can use them from
> there, and again all works nicely.
>
> I was just curious why they don't show up when I use --dumpextensions.
>
> It looks like each LibEXSLT extension is added individually using
> xsltRegisterExtModuleFunction() or xsltRegisterExtensionModuleElement()
> instead of xsltRegisterExtModule() to do whole modules.
>
> I just wondered if there's a reason for doing that this way instead? From
> trawling the mailing lists, I found this:
>
> "You don't need xsltRegisterExtModule() until you need to share data
> between several extensions (functions or elements) in the same module
> (same namespace URI) or need to do something before or after using an
> extension."
>
> So, is the preferred method to register each function/element
> individually? I'd thought that registering the whole module was simpler...
Well, I think it's historical, the initial API allowed only individual
function registration, and the module support was added because people
needed to have some context (like a database connection) persistance
across call to extensions.
Actually is you have good example of doing some module extensions
that's something which should be added to the documentation, like the
examples for libxml2 http://xmlsoft.org/examples/index.html
doing something similar for libxslt/libexslt would be useful, probably
not very hard based on the existing libxml2 indexing code.
If you have good examples (didactic and standalone) I would appreciate
contributions :-)
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]