]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/xslt/toplevel_header.xsl
###############################################################
[helm.git] / helm / on-line / xslt / toplevel_header.xsl
diff --git a/helm/on-line/xslt/toplevel_header.xsl b/helm/on-line/xslt/toplevel_header.xsl
new file mode 100644 (file)
index 0000000..4dc5a88
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory"
+  xmlns:helm="http://www.cs.unibo.it/helm"
+  xmlns:html="http://www.w3.org/1999/xhtml">
+
+<!-- add theory's breadcrumb trail -->
+<xsl:template name="breadcrumb_trail">
+  <xsl:param name="path" select="''" />
+  <xsl:param name="acc" select="''" />
+  <xsl:choose>
+    <xsl:when test="contains($path, '/')">
+      <xsl:variable name="segment" select="substring-before($path,'/')" />
+      <xsl:variable name="newacc" select="concat($acc, $segment, '/')" />
+      <html:a style="text-decoration: none" href="{$newacc}" helm:helm_link="href">
+       <xsl:value-of select="$segment" />
+      </html:a>
+      <xsl:text>/</xsl:text>
+      <xsl:call-template name="breadcrumb_trail">
+       <xsl:with-param name="path" select="substring-after($path,'/')" />
+       <xsl:with-param name="acc" select="$newacc" />
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$path" />
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="add_breadcrumb_trail">
+  <xsl:param name="CICURI" select="''"/>
+<!--   <xsl:param name="prefix" select="''"/> -->
+  <xsl:variable name="prefix" select="substring-before($CICURI, ':')" />
+  <html:h3 style="font-family: sans-serif">
+    <html:a style="text-decoration: none" href="{concat($prefix, ':/')}">
+      <xsl:value-of select="concat($prefix, ':')" />
+    </html:a>
+    <xsl:text>/</xsl:text>
+    <xsl:call-template name="breadcrumb_trail">
+      <xsl:with-param name="path" 
+       select="substring($CICURI, string-length($prefix)+3)" />
+      <xsl:with-param name="acc" select="concat($prefix, ':/')" />
+    </xsl:call-template>
+  </html:h3>
+  <html:hr />
+</xsl:template>
+
+</xsl:stylesheet>