Solved

how to call javascript with more than one parameter in xsl file and parameter are the xml taag values

Posted on 2009-05-11
3
381 Views
Last Modified: 2013-11-18
how to call javascript with more than one parameter in xsl file and parameter are the xml taag values
<?xml version="1.0" ?> 

<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0"> 

<channel> 

          <title>Assurance</title> 

          <link>gmail.com</link> 

           <description>ess Alert</description> 

             <item> 

                           <userID>_b</userID> 

               <item>

<channel>
 

above is the xml file

-------------------------------------------------------------

<a class="buttonGo" href="#">

<xsl:attribute name="onclick">

<xsl:value-of select="'javascript:getControls('"/>

<xsl:value-of select="link"/>

<xsl:value-of select="');'"/>

</xsl:attribute></a>
 

I am using this function  in the html how can i pass one more parameter to the above function like' title' from the xml.
 

abve is the xsl code
 

------------------------------------------

function getControls(link,title)

{

}

code in the html

Open in new window

0
Comment
Question by:mkarthik415
  • 2
3 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24361486
<a class="buttonGo" href="#">
<xsl:attribute name="onclick">
<xsl:value-of select="'javascript:getControls('"/>
<xsl:value-of select="link"/>
<xsl:text>','</xsl:text>
<xsl:value-of select="title"/>
<xsl:value-of select="');'"/>
</xsl:attribute></a>
0
 

Author Comment

by:mkarthik415
ID: 24365997
what would be the below code for two parameter, Thank you in advance

<xsl:value-of select="'javascript:getControls(&quot;'"/>
<xsl:value-of select="link"/>
<xsl:value-of select="'&quot;);'"/>
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 24366075
you are making it so unnecessary difficult by using value-of for string values

<xsl:text>javascript:getControls('</xsl:text>
<xsl:value-of select="link"/>
<xsl:text>','</xsl:text>
<xsl:value-of select="title"/>
<xsl:text>');</xsl:text>

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SVG Logo 4 33
Bootstrap 3 icons 3 39
PHP Undefined Index in HTML Form? 2 32
two div layout one vertical other horizontal. 5 6
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now