]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/xslt/resolve_topurl.xsl
ocaml 3.09 transition
[helm.git] / helm / on-line / xslt / resolve_topurl.xsl
index 6950471088529b9767f01b4637d465ae54516de5..c7f66437463d08c78224b1bf2702fc464954f5d7 100644 (file)
 <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:choose>
+  <xsl:when test="$uri_before_body = ''">
+   <xsl:variable name="uri_before_sharp" select="substring-before($uri,'#')"/>
+   <xsl:choose>
+    <xsl:when test="$uri_before_sharp = ''">
+     <xsl:value-of select="$uri"/>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$uri_before_sharp"/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="$uri_before_body"/>
+  </xsl:otherwise>
+ </xsl:choose>
 </xsl:template>
 
 <xsl:template match="subst:base_CICURI">