Help required in XSLT
Posted: Mon Jan 24, 2005 6:07 pm
I am using XSLT to launch a popup from a link in my JSP page (XML data).
It works great for all the cases except for the links where the link name
contains a single quote character (something like CIELO D'AMERICA).
I have 2 java script functions which are called by the XSLT.
My code sample is as follows:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<HTML>
<SCRIPT language="JavaScript">
function openWindow(url)
{
var vesselWin = window.open (url,"newWindow","toolbar=no,width=300,height=200,scrollbars=yes,resize=yes,menubar=no");
myWin.focus();
}
function openWindow(url,param1,param2,param3)
{
url = url + '&name1='+param1+'&name2='+param2+'&code='+param3;
var myWin2 = window.open(url,"newWindow","toolbar=no,width=300,height=200,scrollbars=yes,resize=yes,menubar=no");
myWin2.focus();
}
</SCRIPT>
...........................
The above Java script functions are called as follows.
<A class="linkUnderline" >
<xsl:attribute name="HREF">javascript:openWindow('<xsl:value-of select="normalize-space(./test/infolink)"/>');</xsl:attribute>
<FONT COLOR="#000000" ><xsl:value-of disable-output-escaping='yes' select="./test/name"/></FONT>
</A>
<A class="linkUnderline" >
<xsl:attribute name="HREF">javascript:openWindow('<xsl:value-of select="normalize-space(../link)"/>','<xsl:value-of select="normalize-space(../../../test/name)"/>','<xsl:value-of select="normalize-space(../../../testname2)"/>','<xsl:value-of select="normalize-space(../../../test/code)"/>' );</xsl:attribute>
<FONT COLOR="#000000" ><xsl:value-of select="../stopdate"/></FONT>
</A>
Any help will be highly appreciated.
Thanks in advance.
It works great for all the cases except for the links where the link name
contains a single quote character (something like CIELO D'AMERICA).
I have 2 java script functions which are called by the XSLT.
My code sample is as follows:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<HTML>
<SCRIPT language="JavaScript">
function openWindow(url)
{
var vesselWin = window.open (url,"newWindow","toolbar=no,width=300,height=200,scrollbars=yes,resize=yes,menubar=no");
myWin.focus();
}
function openWindow(url,param1,param2,param3)
{
url = url + '&name1='+param1+'&name2='+param2+'&code='+param3;
var myWin2 = window.open(url,"newWindow","toolbar=no,width=300,height=200,scrollbars=yes,resize=yes,menubar=no");
myWin2.focus();
}
</SCRIPT>
...........................
The above Java script functions are called as follows.
<A class="linkUnderline" >
<xsl:attribute name="HREF">javascript:openWindow('<xsl:value-of select="normalize-space(./test/infolink)"/>');</xsl:attribute>
<FONT COLOR="#000000" ><xsl:value-of disable-output-escaping='yes' select="./test/name"/></FONT>
</A>
<A class="linkUnderline" >
<xsl:attribute name="HREF">javascript:openWindow('<xsl:value-of select="normalize-space(../link)"/>','<xsl:value-of select="normalize-space(../../../test/name)"/>','<xsl:value-of select="normalize-space(../../../testname2)"/>','<xsl:value-of select="normalize-space(../../../test/code)"/>' );</xsl:attribute>
<FONT COLOR="#000000" ><xsl:value-of select="../stopdate"/></FONT>
</A>
Any help will be highly appreciated.
Thanks in advance.