xsl-list
[Top] [All Lists]

Re: xsl variable not resolved in javascript output again

2005-05-18 20:52:29


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("&lt;a href='" + showframeURL + "' title='<xsl:value-of
select="$title"/>'>&lt;font face='verdana, arial, helvetica, sans serif'
size='1'>Show Book&lt;/font>&lt;/a>");
}
else
{
document.write("&lt;a href='" + hideframeURL + "' target='_top' title
='<xsl:value-of select="$hide"/>'>&lt;font face='verdana, arial, helvetica,
sans serif' size='1'>Hide Book&lt;/font>&lt;/a>");
}
}
showbook();

</script>

 </xsl:template>







                                                                                
                                   
                    "Annmarie                                                   
                                   
                    Rubin                To:     
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>                              
   
                    \(anrubin\)"         cc:     "Annmarie Rubin \(anrubin\)" 
<anrubin(_at_)cisco(_dot_)com>, (bcc:           
                    <anrubin(_at_)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(_at_)lists(_dot_)mulberrytech(_dot_)com
From: David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk>
Subject: Re: [xsl] xsl variable not resolved in javascript output
Message-Id: 
<200505121546(_dot_)QAA17137(_at_)penguin(_dot_)nag(_dot_)co(_dot_)uk>

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("&lt;a href='" + showframeURL + "' title='Show table of
contents and index'>&lt;font face='verdana, arial, helvetica, sans
serif'
size='1'>Show Book&lt;/font>&lt;/a>");
}
else
{
document.write("&lt;a href='" + hideframeURL + "' target='_top'
title='Hide table of contents and index'>&lt;font face='verdana, arial,
helvetica, sans serif' size='1'>Hide Book&lt;/font>&lt;/a>");
}
}
showbook();
//</xsl:comment>

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>