xsl-list
[Top] [All Lists]

xsl variable not resolved in javascript output again

2005-05-18 18:42:04
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>
--~--



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