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
382 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

808 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