Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Pass Parameter to XSLT Using PERL

Reply
Thread Tools

Pass Parameter to XSLT Using PERL

 
 
Neal
Guest
Posts: n/a
 
      10-19-2003
I need to know how to pass a parameter from PERL to an XSLT when using
that XSLT to transform XML. For instance, I'd like to pass a paramter
that I retrieve from the queryString and pass it into XSLT which will
create my HTML.

Here's what I have for the basic transformation:

#!/usr/local/bin/perl
use XML::XSLT;/

$xmlfile = "resume.xml";
$xslfile = "resume.xsl";

$parser = XML::XSLT->new ($xslfile);
$parser->transform($xmlfile);
$parser->print_result();

Does anyone know what I would need to pass the paramter?

Thanks.
Neal
 
Reply With Quote
 
 
 
 
Neal
Guest
Posts: n/a
 
      10-19-2003
Actually, I figured out (in theory) how to pass a parameter to an XSL.
I just added a string into the args:

$parser->transform($xmlfile, test => "'hello world'");

Now the problem seems to be that the XSL is ignoring it's parameters
and variables. Perhaps the parser is set to not work with these by
default or something? Man, what a pain is the ass!

Does anyone know how to get PERL to interpret variables and params in
an XSLT?

Thanks.
Neal
 
Reply With Quote
 
 
 
 
Jim Gibson
Guest
Posts: n/a
 
      10-20-2003
In article < >, Neal
<> wrote:

> Actually, I figured out (in theory) how to pass a parameter to an XSL.
> I just added a string into the args:
>
> $parser->transform($xmlfile, test => "'hello world'");
>
> Now the problem seems to be that the XSL is ignoring it's parameters
> and variables. Perhaps the parser is set to not work with these by
> default or something? Man, what a pain is the ass!
>
> Does anyone know how to get PERL to interpret variables and params in
> an XSLT?
>
> Thanks.
> Neal


FYI: this newsgroup is defunct. You might want to try
comp.lang.perl.modules for this question (and comp.lang.perl.misc for
general perl questions in the future).
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass a parameter for a function parameter in a function AzamSharp Javascript 2 07-05-2008 12:24 AM
Using declaration inside first template parameter as default valuefor second template parameter. Stuart Redmann C++ 5 12-14-2007 08:42 AM
Command line options: using an [option: parameter] without a parameter passed to it soren625 Perl Misc 10 12-28-2005 09:26 PM
Multiple XSLT Transforms using a Controller XSLT sneill@mxlogic.com XML 2 10-19-2005 11:00 AM
is it possible to get hidden parameter values using window.opener.document.form.parameter.value. Abdul Mohsin Javascript 1 09-06-2005 03:38 PM



Advertisments