]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/link.xsl
...
[helm.git] / helm / style / link.xsl
index c5c31a470098f4e23165bf5770e9bba8299c78ad..e6d639a3bcf151aa92e47031597e26b5902232a3 100644 (file)
@@ -39,6 +39,8 @@
 
 <xsl:key name="id" use="@id" match="m:*"/>
 
+<xsl:param name="URLs_or_URIs" select="'URLs'"/>
+
 <xsl:template match = "m:semantics">
    <xsl:apply-templates select="*[1]" mode="semantics"/>
 </xsl:template>
@@ -48,11 +50,18 @@ xlink:href) -->
 <xsl:template match = "*" mode="semantics">
   <xsl:copy>
    <xsl:copy-of select="@*"/>
-   <xsl:if test="@m:xref">
-    <xsl:variable name="cnode" select="key('id',@m:xref)"/>
+   <xsl:if test="@xref">
+    <xsl:variable name="cnode" select="key('id',@xref)"/>
     <xsl:if test="$cnode/@definitionURL"> 
      <xsl:attribute name="xlink:href">
-      <xsl:call-template name="makeURL"><xsl:with-param name="uri" select="$cnode/@definitionURL"/></xsl:call-template>
+      <xsl:choose>
+       <xsl:when test="$URLs_or_URIs = 'URLs'">
+        <xsl:call-template name="makeURL"><xsl:with-param name="uri" select="$cnode/@definitionURL"/></xsl:call-template>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:value-of select="$cnode/@definitionURL"/> 
+       </xsl:otherwise>
+      </xsl:choose>
      </xsl:attribute>
     <!-- xlink:show='other' requires the exact modality to be -->
     <!-- specified in non-xlink markup. The point is that the -->
@@ -93,6 +102,12 @@ xlink:href) -->
      </xsl:attribute>
      <xsl:attribute name="target">theory</xsl:attribute>
     </xsl:when>
+    <xsl:when test="starts-with(@href,&quot;#&quot;)">
+     <xsl:attribute name="href"><xsl:value-of  select="@href"/></xsl:attribute>
+     <xsl:if test="@target">
+      <xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
+     </xsl:if>
+    </xsl:when>
     <xsl:otherwise>
      <xsl:attribute name="href"><xsl:value-of  select="@href"/></xsl:attribute>
      <xsl:attribute name="target">_blank</xsl:attribute>
@@ -110,4 +125,3 @@ xlink:href) -->
 </xsl:template>
 
 </xsl:stylesheet> 
-