469,356 Members | 2,043 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

Pass Parameter to XSLT Using PERL

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
Jul 19 '05 #1
2 4187
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
Jul 19 '05 #2
In article <e7**************************@posting.google.com >, Neal
<ne********@yahoo.com> 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).
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Salmo Bytes | last post: by
2 posts views Thread by arthuryeung198 | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.