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
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

630 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