in reply to Just use an XSLT stylesheet
Please note that XML::LibXSLT, the XSLT companion to XML::LibXML offers the "register_function" functionality which allows Perl functions to be called from stylesheets. An example (directly from the XML::LibXSLT documentation):
and then later in a XSLT stylesheet:XML::LibXSLT->register_function("urn:foo", "bar", sub { scalar localt +ime });
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="urn:foo"> <xsl:template match="/"> The time is: <xsl:value-of select="foo:bar()"/> </xsl:template> </xsl:stylesheet>
This implies that CPAN modules can be made available at least in stylesheets using XML::LibXSLT.
I've used this approach for a client, who is now running about 40 syndicated websites out of a single database in production using this approach. Even the associated CMS is using XML::LibXSLT with special custom functions for handling forms and updating the underlying database.
Typical modules that I've made available that way (directly or indirectly) are DBI, LWP::UserAgent, POSIX, Digest::MD5, Email::Valid, Time::ParseDate, etc. etc. etc.
Liz
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Just use an XSLT stylesheet
by mirod (Canon) on Apr 12, 2004 at 12:48 UTC | |
by liz (Monsignor) on Apr 12, 2004 at 13:14 UTC |