473,888 Members | 1,635 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 4397
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
7725
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
14252
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
2186
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
9293
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
2034
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
2202
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
5662
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
6158
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
2615
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
11176
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10772
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10880
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
10434
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
9593
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
7144
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();...
1
4638
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
4241
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3246
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.