<xsl:output method="html" encoding="iso-8859-1"/>
+<xsl:import href="utils.xsl"/>
+
<!-- uri must end with '/' -->
<xsl:param name="uri" select="''"/>
<xsl:param name="keys" select="''"/>
<img border="0" src="{concat($interfaceURL,'/icons/',$icon)}" alt="[{$alt}]"/>
</td>
<td>
-<!-- Substituted with next lines to avoid Mozilla 0.8 bug setting this.search
- <a
- onClick=
- "top.{$target}uri='{$uri}';
- refresh{$target}Header('{$interfaceURL}/html/library/header.html');
- this.search='?keys={$keys}' +
- '&xmluri=' + escape('{$getterURL}ls?format=xml'+'&baseuri={$uri}')+
- '&param.uri={$uri}' +
- '&param.keys={$keys}' +
- '&param.getterURL={$getterURL}' +
- '&param.target={$target}' +
- '&param.interfaceURL={$interfaceURL}';"
- onMouseOver="window.status='{$uri}'; return true"
- href="apply"
- ><xsl:value-of select="$basename"/></a>
--->
+ <xsl:variable name="quoteduri">
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="$uri"/>
+ </xsl:call-template>
+ </xsl:variable>
<a
onClick=
- "top.{$target}uri='{$uri}';
+ "top.{$target}uri='{$quoteduri}';
refresh{$target}Header('{$interfaceURL}/html/library/header.html');
var search='?keys={$keys}' +
- '&xmluri=' + escape('{$getterURL}ls?format=xml'+'&baseuri={$uri}')+
- '&param.uri={$uri}' +
+ '&xmluri=' + escape('{$getterURL}ls?format=xml'+'&baseuri={$quoteduri}')+
+ '&param.uri={$quoteduri}' +
'&param.keys={$keys}' +
'&param.getterURL={$getterURL}' +
'&param.target={$target}' +
pathname = '/' + pathname;
this.href=
this.protocol + '//' + this.host + pathname + search + this.hash;"
- onMouseOver="window.status='{$uri}'; return true"
+ onMouseOver="window.status='{$quoteduri}'; return true"
href="apply"
><xsl:value-of select="$basename"/></a>
</td>
<img border="0" src="{concat($interfaceURL,'/icons/',$icon)}" alt="[{@name}]"/>
</td>
<td>
+ <xsl:variable name="quoteduri">
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="$uri"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="quotedname">
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="$name"/>
+ </xsl:call-template>
+ </xsl:variable>
<a href="" target="{$target}"
- onClick="this.href=makeURL('{$target}','{concat($uri,$name)}','{$ann}','{$types}')"
- onMouseOver="window.status='{concat($uri,$name)}'; return true"
+ onClick="this.href=makeURL('{$target}','{concat($quoteduri,$quotedname)}','{$ann}','{$types}')"
+ onMouseOver="window.status='{concat($quoteduri,$quotedname)}'; return true"
><xsl:value-of select="$name"/></a>
</td>
</tr>
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:subst="http://www.cs.unibo.it/helm/subst">
+<xsl:import href="utils.xsl"/>
+
<xsl:param name="CICURI" select="''"/>
<xsl:param name="getterURL" select="''"/>
<xsl:param name="draw_graphURL" select="''"/>
<xsl:variable name="BaseRDFURLForward" select="concat($BaseRDFURL,'forward//')"/>
<xsl:variable name="BaseRDFURLBackward" select="concat($BaseRDFURL,'backward//')"/>
-<!-- Next function to quote strings for JavaScript (i.e. ' ==> \' -->
-<xsl:template name="jsquote">
- <xsl:param name="s" select="''"/>
- <xsl:param name="news" select="''"/>
- <xsl:choose>
- <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
- <xsl:otherwise>
- <xsl:variable name="char" select="substring($s,1,1)"/>
- <xsl:choose>
- <xsl:when test='$char = "'"'>
- <xsl:call-template name="jsquote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select='concat($news,"\\\'")'/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="jsquote">
- <xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,$char)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
<xsl:template match="/">
<html>
<head>
<xsl:variable name="quotedCICURI">
<xsl:call-template name="jsquote">
<xsl:with-param name="s" select="$CICURI"/>
+ <xsl:with-param name="times" select="2"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
--- /dev/null
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- Next function to quote strings for JavaScript (i.e. ' ==> \' -->
+<xsl:template name="jsquote">
+ <xsl:param name="s" select="''"/>
+ <xsl:param name="news" select="''"/>
+ <xsl:param name="times" select="1"/>
+ <xsl:choose>
+ <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="char" select="substring($s,1,1)"/>
+ <xsl:choose>
+ <xsl:when test='$char = "'" and $times = 1'>
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select='concat($news,"\'")'/>
+ <xsl:with-param name="times" select="$times"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test='$char = "'" and $times = 2'>
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select='concat($news,"\\\'")'/>
+ <xsl:with-param name="times" select="$times"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select="concat($news,$char)"/>
+ <xsl:with-param name="times" select="$times"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>