]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/xslt/metadataLib.xsl
There were still many problems with URIs with a ' in the middle.
[helm.git] / helm / on-line / xslt / metadataLib.xsl
index ef45c40ea8b0e0fbaaead364aa6c75c21d9b0cb0..e807cc00f9e71b9c6c329334b3e7a24afbda7338 100644 (file)
@@ -4,6 +4,8 @@
  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 = "&apos;"'>
-     <xsl:call-template name="jsquote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select='concat($news,"\\\&apos;")'/>
-     </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>
@@ -77,6 +53,7 @@
  <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>