473,800 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing parameters from xsl to cgi script

I have made a perl script witch gets information out of a database,
transfers it into an xml-file file and than I parse this to a html document
using xsl.
The problem is dat the html doc needs a parameter which can be found in the
xml file.
I've done something like
<xsl:variable name="id" select="person_ id"/>
<a href="http://localhost/CGI/detailsselectio n.cgi?ID=$id">< xsl:value-of
select="name"></xsl:value-of><xsl:value-of
select="first_n ame"></xsl:value-of></a>

Of course this doesn't give me the value of the id-variable. But it just
returns $id.
How can I solve this?

Thanks

L

Jul 20 '05 #1
2 2393
On Tue, 23 Nov 2004 12:23:01 +0100, "lievemario "
<li********@hot mail.com> wrote:
I have made a perl script witch gets information out of a database,
transfers it into an xml-file file and than I parse this to a html document
using xsl.
The problem is dat the html doc needs a parameter which can be found in the
xml file.
I've done something like
<xsl:variable name="id" select="person_ id"/>
<a href="http://localhost/CGI/detailsselectio n.cgi?ID=$id">< xsl:value-of
select="name"> </xsl:value-of><xsl:value-of
select="first_ name"></xsl:value-of></a>

Of course this doesn't give me the value of the id-variable. But it just
returns $id.
How can I solve this?


This should work -- instead of putting the $id variable into the href
attribute directly in the <a> tag, make the href into an xsl:attribute,
and then you can do fancier processing of it in the contents of that xsl
element:

<a>
<xsl:attribut e name="href">
<xsl:value-of

select="concat( 'http://localhost/CGI/detailsselectio n.cgi?ID=',$id) "/>
</xsl:attribute>
<xsl:value-of select="name"/> <xsl:value-of select="first_n ame"/>
</a>

(Note also that since your <xsl:value-of> elements selecting the name
and first name don't have any contents, I've normalized them into
self-closing tags, instead of having separate </xsl:value-of> closing
tags.
--
Morris M. Keesan -- ke****@alum.bu. edu

Jul 20 '05 #2
Another question about this:

So now I have passed the id, and I would like to use it in an sql query,
but the combination
my $id = param('id');
and
select .....where id = $id;
gives an error

is there a solution for this?
"lievemario " <li********@hot mail.com> schreef in bericht
news:cn******** **@snic.vub.ac. be...
I have made a perl script witch gets information out of a database,
transfers it into an xml-file file and than I parse this to a html document using xsl.
The problem is dat the html doc needs a parameter which can be found in the xml file.
I've done something like
<xsl:variable name="id" select="person_ id"/>
<a href="http://localhost/CGI/detailsselectio n.cgi?ID=$id">< xsl:value-of select="name"></xsl:value-of><xsl:value-of
select="first_n ame"></xsl:value-of></a>

Of course this doesn't give me the value of the id-variable. But it just
returns $id.
How can I solve this?

Thanks

L


Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1875
by: JD | last post by:
I want to pass two parameters to a simple script running on my web server. The script "parpass.php" looks like this: <?php echo "The total number of parameters passed was: $argc \n"; echo "The parameters passed were: "; foreach (argv as $val) { echo "$val "; }
1
3325
by: JD | last post by:
I posted this earlier and it disappeared from the NewsGroup I want to pass two parameters to a simple script running on my web server. The script "parpass.php" looks like this: <?php echo "The total number of parameters passed was: $argc \n"; echo "The parameters passed were: "; foreach (argv as $val) {
0
1263
by: BB | last post by:
I am calling my C++ function (in a DLL) from a python script as follows: _dllcall('add','ll','l',(var1,var2)) This works fine if the 2 parameters accepted by the function are normal "long" type. If the function expects a pointer type parameter then the same way of passing the parameter doesn't work. For example if the C++ function expects a "long *" and I am calling it as:
1
4207
by: Mike Wimpe | last post by:
Without creating a form, how do i pass a value to another script? I would like to pass: group = "Oranges" to another script or at least just 'group' and initialize it in the first script. script1:
7
49586
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. The question is about best practices for passing parameters to an event function. I have, say, the following HTML:
3
14956
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
4
3851
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it. My client-side JavaScript function takes 4 parameters (which are expected to be integers). The idea of passing a single parameter and parsing it on the client has occurred to me, but since I am sure I am not the only person who has situations that...
4
2386
by: simon | last post by:
hi, I would like to separate my javascript completely from my xhtml. in the end there should be only <script type="text/javascript" src="javalib.js"></script> in the head-tag to my javascript. Because I want to use some ajax-requests and other javascript-functions on my xhtml, I need to dynamically add event handlers to any possible dom-elements. All solutions I found so fare are for specific, pre-known
0
2102
by: oakwoodman | last post by:
I have a UNIX script that invokes a DB2 UDB .sql script. I need to pass parameters to the .sql script from the .sh. How does one reference the parameters in the .sql script? The .sql script is not a procedure construct.
2
4439
by: luis | last post by:
I'm using ctypes to call a fortran dll from python. I have no problems passing integer and double arryas, but I have an error with str arrys. For example: ..... StringVector = c_char_p * len(id) # id is a list of strings Id_dat=StringVector() for i in range(len(Id)): ....Id_dat=id
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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,...
0
10275
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
10253
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
10033
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
9085
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
6811
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
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2945
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.