]> matita.cs.unibo.it Git - helm.git/commitdiff
Links in the control frame when the URI ends with .body are now handled
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 28 May 2004 14:12:21 +0000 (14:12 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 28 May 2004 14:12:21 +0000 (14:12 +0000)
correctly (i.e. the .body is removed if meaningless, as for the proof-checker
or the metadata).

helm/on-line/html/cic/control.html
helm/on-line/xslt/resolve_topurl.xsl

index f41168d2836ee9350511555fe5f93b66210fb069..126772343a2989ab13f6d3f00604bba72266b002 100644 (file)
@@ -18,6 +18,7 @@ h2.uri { margin-top: 0ex; margin-bottom: 0ex }
 <script>
  var annotations="<subst:annotations/>";
  var CICURI="<subst:CICURI/>";
+ var cleanCICURI="<subst:cleanCICURI/>";
  var CICURL = "<subst:CICURL/>";
  var DCRDFURL = "<subst:DCRDFURL/>";
  var DirectRDFURL = "<subst:DirectRDFURL/>";
@@ -88,9 +89,9 @@ h2.uri { margin-top: 0ex; margin-bottom: 0ex }
   <li>
     <script>
      var url = processorURL + "apply?keys=MC%2CRT%2CL&amp;xmluri=" +
-         getterURL + "getxml%3Furi%3D" + CICURI +
+         getterURL + "getxml%3Furi%3D" + cleanCICURI +
          "&amp;prop.media-type=text/html&amp;prop.encoding=iso-8859-1" +
-         "&amp;param.CICURI=" + CICURI + "&amp;param.profile=" + profile +
+         "&amp;param.CICURI=" + cleanCICURI + "&amp;param.profile=" + profile +
          "&amp;profile=" + profile;
      document.write(
       '<a target="result" href="' + url + '">View metadata</a>'
@@ -99,7 +100,7 @@ h2.uri { margin-top: 0ex; margin-bottom: 0ex }
   </li>
   <li>
     <script>
-     url = proofcheckerURL + "proofCheck?uri=" + CICURI;
+     url = proofcheckerURL + "proofCheck?uri=" + cleanCICURI;
      document.write(
       '<a target="result" href="' + url + '">Proof check</a>'
      );
index c2ad9e28c132ddc956b14178294d07f7b5353dcd..a075e6a15327c57c97a3437079ee9b3a6b432a3b 100644 (file)
  <xsl:value-of select="$CICURI"/>
 </xsl:template>
 
+<xsl:template match="subst:cleanCICURI">
+ <xsl:variable name="uri" select="$CICURI"/>
+ <xsl:variable name="uri_before_body" select="substring-before($uri,'.body')"/>
+ <xsl:variable name="cleanuri">
+  <xsl:choose>
+   <xsl:when test="$uri_before_body = ''">
+    <xsl:value-of select="$uri"/>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$uri_before_body"/>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$cleanuri"/>
+</xsl:template>
+
 <xsl:template match="subst:base_CICURI">
   <xsl:variable name="len" select="string-length($CICURI)" />
   <xsl:variable name="extension">