Need to run Javascript during XSL transformation

I have a web page where the html is created via an XSL stylesheet. The data is in a table, row, column format. One of the columns has a link button that when clicked some javascript builds a table of data and inserts it under the existing row. The user wants this table displayed always (without clicking the link).

Question: How do I get my existing javascript to run in-place when the page is loaded?

<td width="15%" onmouseover="MouseOver(this)" align="right" onclick="ShowUsage('{CITEM}', '{WUSED}')" >
	<strong>
		<font size="1" face="Tahoma" color="#004080">
			<U>raw materials</U>
		</font>
	</strong>
</td>

Open in new window

LVL 8
Bob HoffmanDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

basicinstinctCommented:
A zillion ways to do it, this is the most basic:

<body onload="ShowUsage('{CITEM}', '{WUSED}')">
0
Bob HoffmanDeveloperAuthor Commented:
It needs to run once for each row in the table.
0
Bob HoffmanDeveloperAuthor Commented:
basicinstinct:
 I think the below code snipet illustrates how I'm suppose to do it, but when I run it I get a "ClassNotFoundExecption" on urn:custom-javascript. I have no clue how to fix that error.
or maybe this approach is all wrong?
 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
		xmlns:msxsl="urn:schemas-microsoft-com:xslt"   
		xmlns:js="urn:custom-javascript"> 
 
<msxsl:script language="JavaScript" implements-prefix="js"> 
<![CDATA[
function ShowUsage(item, wused)  
{
 // my code
}
]]>
</msxsl:script>
 
 
 
<td colspan="4">
     <xsl:value-of select="js:ShowUsage('{CITEM}', '{WUSED}')"/>
</td>
 
 
 
								 <xsl:value-of select="js:ShowUsage('{CITEM}', '{WUSED}')"/>
							</td>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.