473,511 Members | 10,195 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/detailsselection.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?

Thanks

L

Jul 20 '05 #1
2 2376
On Tue, 23 Nov 2004 12:23:01 +0100, "lievemario"
<li********@hotmail.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/detailsselection.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:attribute name="href">
<xsl:value-of

select="concat('http://localhost/CGI/detailsselection.cgi?ID=',$id)"/>
</xsl:attribute>
<xsl:value-of select="name"/> <xsl:value-of select="first_name"/>
</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********@hotmail.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/detailsselection.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?

Thanks

L


Jul 20 '05 #3

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

Similar topics

4
1859
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...
1
3311
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...
0
1249
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"...
1
4188
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. ...
7
49557
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. ...
3
14908
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) {...
4
3820
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....
4
2362
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....
0
2085
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...
2
4402
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 *...
0
7251
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,...
0
7148
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...
0
7367
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,...
0
7430
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...
0
7517
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...
0
5673
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,...
0
4743
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...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
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 ...

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.