]> matita.cs.unibo.it Git - helm.git/commitdiff
URIs containing # are now threaded in the "right" way,
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 9 May 2001 14:15:18 +0000 (14:15 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 9 May 2001 14:15:18 +0000 (14:15 +0000)
which is

 The #-part is removed, the URL to uwobo is generated and
 the removed #-part is appended to the computed URL.

Note: in this way the #-part is not passed to the getter and then
back to the source. For a #-part this seems reasonable, but could
not work with CGIs looking to the #-part. (Do they exist?)

helm/style/links_library.xsl

index 18db37a0ca2835d1710fc7bcc4fbbb290a508e29..1457169fd34f0d975930ef58b84f3b767c4e481e 100644 (file)
 <!-- type, instead, is not propagated                                -->
 <xsl:template name="makeURL">
 <xsl:param name="uri" select="''"/>
+ <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
+ <xsl:variable name="cleanuri">
+  <xsl:choose>
+   <xsl:when test="$uri_after_sharp">
+    <xsl:value-of select="substring-before($uri,'#')"/>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$uri"/>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sharpsuffix">
+  <xsl:choose>
+   <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
+   <xsl:otherwise></xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
      <xsl:value-of select="$biquotedfixedheader"/>
-     <xsl:value-of select="$uri"/>%26param.CICURI%3D<xsl:value-of select="$uri"/>
+     <xsl:value-of select="$cleanuri"/>%26param.CICURI%3D<xsl:value-of select="$cleanuri"/>
+     <xsl:value-of select="$sharpsuffix"/>
 </xsl:template>
+
 <xsl:template name="makeTheoryURL">
 <xsl:param name="uri" select="''"/>
+ <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
+ <xsl:variable name="cleanuri">
+  <xsl:choose>
+   <xsl:when test="$uri_after_sharp">
+    <xsl:value-of select="substring-before($uri,'#')"/>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$uri"/>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sharpsuffix">
+  <xsl:choose>
+   <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
+   <xsl:otherwise></xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
      <xsl:value-of select="$biquotedthfixedheader"/>
-     <xsl:value-of select="$uri"/>%26param.CICURI%3D<xsl:value-of select="$uri"/>
+     <xsl:value-of select="$cleanuri"/>%26param.CICURI%3D<xsl:value-of select="$cleanuri"/>
+     <xsl:value-of select="$sharpsuffix"/>
 </xsl:template>
 
 <!-- makeURL4embedding() maps URIs into URLs              -->
 <xsl:template name="makeURL4embedding">
 <xsl:param name="uri" select="''"/>
 <xsl:param name="type" select="'standalone'"/>
+ <xsl:variable name="cleanuri">
+  <xsl:choose>
+   <xsl:when test="$uri_after_sharp">
+    <xsl:value-of select="substring-before($uri,'#')"/>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$uri"/>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sharpsuffix">
+  <xsl:choose>
+   <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
+   <xsl:otherwise></xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
  <xsl:value-of select="$header1"/>
  <xsl:value-of select="$quotedembedkeys"/>
  <xsl:value-of select="$header2"/>
  <xsl:value-of select="$bothheader2"/>
- <xsl:value-of select="$uri"/>&#x26;param.CICURI=<xsl:value-of select="$uri"/>&#x26;param.type=<xsl:value-of select="$type"/>
+ <xsl:value-of select="$cleanuri"/>&#x26;param.CICURI=<xsl:value-of select="$cleanuri"/>&#x26;param.type=<xsl:value-of select="$type"/>
+ <xsl:value-of select="$sharpsuffix"/>
 </xsl:template>
 
 </xsl:stylesheet>