]> matita.cs.unibo.it Git - helm.git/commitdiff
mk_dep_graph.xsl now differentiates the constructors from the
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 18 Oct 2001 10:11:28 +0000 (10:11 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 18 Oct 2001 10:11:28 +0000 (10:11 +0000)
inductive types producing "extended" URIs
(e.g. ".../nat.ind#xpointer(1/1/1)")

helm/style/mk_dep_graph.xsl

index 86933883c9e1cc532190f9fc148a5418b4cc2028..c5c063aecd86188c28bea1f637a494ff8b17d156 100644 (file)
  </xsl:choose>
 </xsl:template>
 
+<!-- CSC: Next function has been copied from         -->
+<!-- CSC: metadata/xslt/occurrences.xsl and modified -->
+<xsl:template name="get_expanded_name">
+ <xsl:param name="node" select="/.."/>
+    <xsl:choose>
+     <xsl:when test="name($node)='CONST'">
+      <xsl:value-of select="$node/@uri"/>
+     </xsl:when>
+     <xsl:when test="name($node)='MUTIND'">
+      <xsl:variable name="noType" select="$node/@noType + 1"/>
+      <xsl:value-of select="concat($node/@uri,'#','xpointer(1/',
+            $noType,')')"/>
+     </xsl:when>
+     <xsl:when test="name($node)='MUTCONSTRUCT'">
+      <xsl:variable name="noType" select="$node/@noType + 1"/>
+      <xsl:value-of select="concat($node/@uri,'#','xpointer(1/',
+           $noType,'/',$node/@noConstr,')')"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <!-- CSC: Is it possible to reach this branch? -->
+      <xsl:value-of select="$node/@uri"/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+
 <xsl:template match="/">
  <!--
  <xsl:text>strict digraph L0 { size = "83,83"; concentrate=true; node [style=filled, shape = box];&CSCbr;</xsl:text>
  <xsl:if test="@uri">
   <xsl:variable name="quotedURI">
    <xsl:call-template name="quote">
-    <xsl:with-param name="s" select="@uri"/>
+    <xsl:with-param name="s">
+     <xsl:call-template name="get_expanded_name">
+      <xsl:with-param name="node" select="."/>
+     </xsl:call-template>
+    </xsl:with-param>
+   </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="quoted_uri">
+   <xsl:call-template name="quote_url">
+    <xsl:with-param name="s">
+     <xsl:call-template name="get_expanded_name">
+      <xsl:with-param name="node" select="."/>
+     </xsl:call-template>
+    </xsl:with-param>
    </xsl:call-template>
   </xsl:variable>
   <!-- The nonce, quotedCurrentCICURI are used to force the document reload -->
-  <xsl:if test="not(name(document(concat($uri_set_queueURL,'add_if_not_in?uri=',@uri,'&amp;nonce=',generate-id(),'&amp;PID=',$PID,'&amp;quotedCurrentCICURI=',$quotedCurrentCICURI))/*)='not_added_because_already_too_many')">
+  <xsl:if test="not(name(document(concat($uri_set_queueURL,'add_if_not_in?uri=',$quoted_uri,'&amp;nonce=',generate-id(),'&amp;PID=',$PID,'&amp;quotedCurrentCICURI=',$quotedCurrentCICURI))/*)='not_added_because_already_too_many')">
    <xsl:text> </xsl:text>
    <xsl:value-of select="$quotedCurrentCICURI"/>
    <xsl:text> -&gt; </xsl:text>