Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Assigning value of xsl variable to javascript variable

843834May 17 2006 — edited May 18 2006
Hi all,


This is my xml code

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Hotels.xsl"?>
<Services>
<SCRIPT_ID>
<XPath name="TBL_SCRIPTID20060318125009281">
</XPath>
</SCRIPT_ID>
</Services>


This is my xsl code

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="scriptid" select="/SCRIPT_ID/XPath/@name"/>

<xsl:template match="/">
<html>
<head>
<script language="javascript">
function showHint1(str)
{
alert("In Show Hint1");
alert("String == "+str);
}

</script>
<body onLoad="showHint1($scriptid);" bgcolor="red">

</body>

</html>
<xsl:apply-templates/>

</xsl:template>
</xsl:stylesheet>


Here i just wants pass the value of the variable scriptid to the javascript function.
Its giving error.Can anyone help me.

thnx,
raj
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2006
Added on May 17 2006
6 comments
432 views