Subject: Re: [xsl] xsl variable not resolved in javascript output again From: omprakash.v@xxxxxxxxxxxxx Date: Thu, 19 May 2005 09:22:29 +0530 |
Hi, I did as follows and got the showbook link to appear. <xsl:template match="/"> <xsl:variable name="fset" select ="/structureddeposits/jsp/BookingResult.jsp"/> <xsl:variable name="title" select="'Show table of contents and index'"/> <xsl:variable name="hide" select="'Hide table of contents and index'"/> <script language="javascript"> function showbook() { var showframeURL = '<xsl:value-of select="$fset"/>' + "?" + document.URL; var hideframeURL = unescape(document.URL); if (window.self == top) { document.write("<a href='" + showframeURL + "' title='<xsl:value-of select="$title"/>'><font face='verdana, arial, helvetica, sans serif' size='1'>Show Book</font></a>"); } else { document.write("<a href='" + hideframeURL + "' target='_top' title ='<xsl:value-of select="$hide"/>'><font face='verdana, arial, helvetica, sans serif' size='1'>Hide Book</font></a>"); } } showbook(); </script> </xsl:template> "Annmarie Rubin To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> \(anrubin\)" cc: "Annmarie Rubin \(anrubin\)" <anrubin@xxxxxxxxx>, (bcc: <anrubin@cisc omprakash.v/Polaris) o.com> Subject: [xsl] xsl variable not resolved in javascript output again 05/19/2005 07:12 AM Please respond to xsl-list David et al, I tried this solution to resolve the xsl:variable in xslt code that outputs javascript code and thought that it was working, but the showbook and hidebook href links still do not display on the transformed html. Can anyone see something I'm missing here? thanks, Ann Marie Date: Thu, 12 May 2005 16:46:26 +010 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx From: David Carlisle <davidc@xxxxxxxxx> Subject: Re: [xsl] xsl variable not resolved in javascript output Message-Id: <200505121546.QAA17137@xxxxxxxxxxxxxxxxx> javascript means nothing to XSLT (any more than english) it is just text. To put the string value of a variable into a text node you use <xsl:value-of select="$__Frameset_File_Name_token"/> so: <xsl:comment> function showbook() { var showframeURL = '<xsl:value-of select="$__Frameset_File_Name_token"/>' + "?" + document.URL; var hideframeURL = unescape(document.URL); if (window.self == top) { document.write("<a href='" + showframeURL + "' title='Show table of contents and index'><font face='verdana, arial, helvetica, sans serif' size='1'>Show Book</font></a>"); } else { document.write("<a href='" + hideframeURL + "' target='_top' title='Hide table of contents and index'><font face='verdana, arial, helvetica, sans serif' size='1'>Hide Book</font></a>"); } } showbook(); //</xsl:comment> David This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl variable not resolved, David Carlisle | Thread | RE: [xsl] xsl variable not resolved, Annmarie Rubin \(anr |
Re: [xsl] XPath query syntax, Jay Bryant | Date | Re: [xsl] XPath query syntax, Aron Bock |
Month |