[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Call perl script within xsl?

Subject: Re: Call perl script within xsl?
From: Steve Ball <Steve.Ball@xxxxxxxxx>
Date: Tue, 29 Jan 2002 11:59:35 +1100
calling perl from xsl
Sabrina Fords wrote:

Can you call a perl script within xsl?

Firstly, you don't say why you want to call Perl from XSLT.
That may help refine exactly what help you need
(it may be the case that what you are endeavouring to do
can be achieved using XSLT alone).

I don't use Perl (thank God!), but I've written an interface
to the Tcl scripting language from the Gnome libxslt library
called TclXSLT.  Apart from being able to invoke an XSLT
transformation from Tcl, this package also allows the XSLT
stylesheet to call into Tcl code (and Tcl can then call
C/C++/whatever).  See http://tclxml.sf.net/tclxslt.html
for more information (but bear in mind that the Web page
is very incomplete at the moment).

Now, the point of my telling you this is that the way
in which this occurs is important.  TclXSLT hides the
scripting from the stylesheet by using extension elements
and functions.  This encourages portability of your
stylesheet, and IMO actually makes writing both the
XSLT stylesheet and scripts easier (since the interfaces
must be well-defined).  Think of EXSLT; it doesn't matter
whether the XSLT processor is implemented using Java or C,
your stylesheet is portable.

However, I've seen some examples of AxKit where the Perl
code appears embedded inside the stylesheet.
I believe that's bad.  Keep the XSLT stylesheet and the
scripting separate, and connect them together using extensions.

Steve Ball

Steve Ball            |   XSLT Standard Library   | Training & Seminars
Zveno Pty Ltd         |     Web Tcl Complete      |   XML XSL Schemas
http://www.zveno.com/ |      TclXML TclDOM        | Tcl, Web Development
Steve.Ball@xxxxxxxxx  +---------------------------+---------------------
Ph. +61 2 6242 4099   |   Mobile (0413) 594 462   | Fax +61 2 6242 4099

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.