]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/link.xsl
Theory level DTD changed and .theory.xml files exported again.
[helm.git] / helm / style / link.xsl
index d5af006e1d72e3b2dc5ada821b1639d0c9fb5964..d3c78eaff1522182fe734206fd826ee6e3c09340 100644 (file)
 </xsl:template>
 
 <!-- _top to refresh the whole frameset (avoids the matrioska effect ;-) -->
-<xsl:template match="a[@href]">
+<!-- a[@href] doesn't match with every anchor elements!!!                -->
+<xsl:template match="*[@href]">
    <xsl:copy>
     <xsl:copy-of select="@*"/> 
-    <xsl:attribute name="href">
-     <xsl:call-template name="makeURL">
-      <xsl:with-param name="uri" select="@href"/>
-     </xsl:call-template>
-    </xsl:attribute>
-    <xsl:attribute name="target">cic</xsl:attribute>
+    <xsl:choose>
+    <xsl:when test="starts-with(@href,&quot;cic&quot;)">
+     <xsl:attribute name="href">
+      <xsl:call-template name="makeURL">
+       <xsl:with-param name="uri" select="@href"/>
+      </xsl:call-template>
+     </xsl:attribute>
+     <xsl:attribute name="target">cic</xsl:attribute>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:attribute name="href">
+      <xsl:call-template name="makeTheoryURL">
+       <xsl:with-param name="uri" select="@href"/>
+      </xsl:call-template>
+     </xsl:attribute>
+     <xsl:attribute name="target">theory</xsl:attribute>
+    </xsl:otherwise>
+    </xsl:choose>
     <xsl:apply-templates/>
    </xsl:copy>
 </xsl:template>
@@ -76,3 +89,4 @@
 </xsl:template>
 
 </xsl:stylesheet> 
+