473,782 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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($xml file);
$parser->print_result() ;

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

Thanks.
Neal
Jul 19 '05 #1
2 4394
Actually, I figured out (in theory) how to pass a parameter to an XSL.
I just added a string into the args:

$parser->transform($xml file, 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********@yah oo.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($xml file, 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7713
by: Salmo Bytes | last post by:
I want to send an xml string as a get parameter, where the xml is created from a runtime database query. I try to avoid dynamic framesets, but sometimes they're needed: $xml = mysql_stuff($x,$y,$z); echo "<frameset...>"; echo "<frame src=".$PHP_SELF."?xml=".$xml.">"; snip....
4
14248
by: Corey | last post by:
All, I am relatively new to XML and I have what may sound like a dumb question. I want to pass a query string variable to my xml document and filter the output based on that variable. For example, if I type in www.mysite.com?geid=0000123468 I want to display only AccessReview/Report where GEID='0000123468'. I appreciate any help you can provide. Corey
3
2182
by: darrel | last post by:
I'm still struggling to figure out the big-picture concept of how to go about building a web site menu from an xml file. The XML file contains the full site structure (the site map, so-to-speak). Based on the current page of the site, I want to be able to do the following: get node that pertains to current page get node's siblings get node's parents
4
9290
by: darrel | last post by:
I think I've gotten the hang of XML and XSLT...at least enough to produce the results I'm looking for. I now need to take the next step and use ASP.NET (using VB.NET) to take the xml and send it to the xslt along with a parameter and get xhtml returned. The catch is that I'm not finding any samples of how to do that. I can find (as usual) some C# examples, and a few VB.NET for client apps samples, but nothing for ASP.NET using VB.NET.
2
2032
by: arthuryeung198 | last post by:
Hi all, I got a JSP using JSTL to transform XML to HTML, and I want to pass a variable "statusFilter" into the XSL. e.g. <x:parse xml="${xml}" var="doc" /> <x:transform xml="${doc}" xslt="${xslt}"> <x:param name="statusFilter"> ABCD </x:param>
0
2197
by: alpha122 | last post by:
I am beginner and I need some help writing simple perl script. I need to get url query and pass it to the javascript function as parameter. for example: my page will be http://myhomepage.html?var1=test1&var2=test2.. These variable could be anything that is entered by user. Now I need to get these variables an pass those values in my javascript function as parameter. Thanks in advance for help..
8
5654
by: Hoi Wong | last post by:
With the XSLT 1.0 engine that I was forced to use, I have to parse old XML scripts where the number (to be parsed and saved into $EPISODE_NUMBER_RAW) that I want to parse is written with a comma seperator if it goes beyond 3 digits. i.e. the variable might be parsed as a string '1,324' or a number 56, depending on which XML file I have. I was trying to get rid of the comma seperator by breaking the string into two parts (that number will...
10
6148
by: getmadhu | last post by:
Hi All, How can i pass a Perl var($val) as a parameter to a Javascript function. Please can any one help me out... ex: Perl Code ---------------- $var = 'sample'
0
2611
Saii
by: Saii | last post by:
How can we pass a perl array to stored procedure in Oracle. The parameter I am using in Oracle is type of table of varchar(500). I am using the system command in perl to execute the procedure Sample: system("sqlplus -S $user_det_orcl <<EOF \n "."whenever sqlerror exit failure; \n"."exec p_test('\@array\');\n"."exit;\n"."EOF\n" ); When I use the above notation, Oracle gives an error about the parameter that parameters types dont match....
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10076
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.