ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
ANNOUNCE: XML::LibXSLT 1.52
by Matt Sergeant other posts by this author
Sep 4 2002 6:59AM messages near this date
view in the new Beta List Site
RE: POSSIBLE BUG in XML::Simple | Re: ANNOUNCE: XML::LibXSLT 1.52
I have just uploaded XML::LibXSLT 1.52 to CPAN.

This is a feature release, introducing Perl extension functions to XSLT.

Here's the docs added for those who can't contain their excitement:

=head2 register_function

   XML::LibXSLT-> register_function($uri, $name, $subref);

Registers an XSLT extension function mapped to the given URI. For 
example:

   XML::LibXSLT-> register_function("urn:foo", "bar",
     sub { scalar localtime });

Will register a C<bar>  function in the C<urn:foo> namespace (which you 
have to define in your XSLT using C<xmlns:...> ) that will return the 
current date and time as a string:

   <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> 

If you pass parameters to your extension function they are all down
converted into strings at runtime - there is no internal access to
nodelists. The return from your function is also just a plain string, 
there is no support for returning a nodelist.

EOPOD

Note that I haven't tested this terribly thoroughly, so it may be buggy 
- I'm relying on the community to tell me.

Matt.

_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Matt Sergeant
Ardo van Rangelrooij
Ardo van Rangelrooij
D. Hageman
Ardo van Rangelrooij
Jason Adams
Matt Sergeant
Petr Pajas
Christian Glahn
Petr Pajas

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved