Re: XML::LibXSLT callbacks - trying to "fake" the namespace prefix
by A. Pagaltzis other posts by this author
Mar 3 2006 1:09PM messages near this date
view in the new Beta List Site
[Announce] XML::XPathScript 1.01
|
Re: XML::LibXSLT callbacks - trying to "fake" the namespace prefix
& XSLT * Randal L. Schwartz <merlyn@[...].com> [2006-03-02 21:10]:
> Does XML::LibXSLT (and perhaps libxslt2) not provide the means
> by which I can register *all* calls from a namespace to be
> mapped to a class? Apparently, I must register each individual
> function instead.
libxslt has `xsltRegisterExtModule`, which translates to XML::LibXSLT
as a vestigial `register_xslt_module` method with a â??not
implementedâ? comment.
However, from the â??Writing Extensionsâ? document of libxslt, it
appears that the initialization function of a module is expected
to individually register each of the extensions it contains.
So it seems there is no way to do what you want at the libxslt
level.
> Can I override XML::LibXSLT::perl_dispatcher somehow to do the
> delivery I want, or will I not get called if I use
> "foo:unknown_function" in my expression? I see $func can be
> either a coderef or a package name there, but it's still being
> mapped on a full Qname basis, not on a prefix basis.
When libxslt encounters an extension function, it triggers the
respective callback; in the case of XML::LibXSLT, thatâ??s always
`perl_dispatcher`, whose job it is to then find the actual
function to send the call to. So whatever you do in
`perl_dispatcher` wonâ??t help, because libxslt wonâ??t be calling it
in the first place if the specific QName is not invidiually
registered.
In short, you canâ??t do that. :-(
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
A. Pagaltzis
Randal L. Schwartz
|