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
377 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
Comment Utility
<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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

771 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

9 Experts available now in Live!

Get 1:1 Help Now