]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mk_meta_and_dep_graph.xsl
This commit was manufactured by cvs2svn to create branch 'init'.
[helm.git] / helm / style / mk_meta_and_dep_graph.xsl
diff --git a/helm/style/mk_meta_and_dep_graph.xsl b/helm/style/mk_meta_and_dep_graph.xsl
deleted file mode 100644 (file)
index a9a9a95..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Copyright (C) 2000, HELM Team                                     -->
-<!--                                                                   -->
-<!-- This file is part of HELM, an Hypertextual, Electronic            -->
-<!-- Library of Mathematics, developed at the Computer Science         -->
-<!-- Department, University of Bologna, Italy.                         -->
-<!--                                                                   -->
-<!-- HELM is free software; you can redistribute it and/or             -->
-<!-- modify it under the terms of the GNU General Public License       -->
-<!-- as published by the Free Software Foundation; either version 2    -->
-<!-- of the License, or (at your option) any later version.            -->
-<!--                                                                   -->
-<!-- HELM is distributed in the hope that it will be useful,           -->
-<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
-<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
-<!-- GNU General Public License for more details.                      -->
-<!--                                                                   -->
-<!-- You should have received a copy of the GNU General Public License -->
-<!-- along with HELM; if not, write to the Free Software               -->
-<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
-<!-- MA  02111-1307, USA.                                              -->
-<!--                                                                   -->
-<!-- For details, see the HELM World-Wide-Web page,                    -->
-<!-- http://cs.unibo.it/helm/.                                         -->
-
-<!-- CSC: Sostituire l'andata a capo con la entity numerica opportuna -->
-<!DOCTYPE html [
- <!ENTITY CSCbr "
-">
-]>
-
-<xsl:stylesheet version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns:h="http:/www.cs.unibo.it/helm/schemas/schema-h.rdf#">
-
-<xsl:output method="text"/>
-
-<xsl:param name="CICURI" select="''"/>
-<xsl:param name="PID" select="''"/>
-<xsl:param name="getterURL" select="''"/>
-<xsl:param name="uri_set_queueURL" select="''"/>
-<xsl:param name="uri_set_size" select="30"/>
-<xsl:variable name="base_URL_of_URI" select="concat($getterURL,'getxml?uri=')"/>
-
-<!-- CSC: next functions because I don't remember the name of the    -->
-<!-- CSC: subst function of xslt and I don't have the specs with me -->
-
-<!-- The next function is used to quote URIs for dotty -->
-<xsl:template name="quote">
- <xsl:param name="s" select="''"/>
- <xsl:param name="news" select="''"/>
- <xsl:choose>
-  <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
-  <xsl:otherwise>
-   <xsl:variable name="char" select="substring($s,1,1)"/>
-   <xsl:choose>
-    <xsl:when test="$char = '/'">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'X')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:when test="$char = ':'">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'Y')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:when test="$char = '.'">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'Z')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:when test='$char = "&apos;"'>
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'W')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:when test="$char = '-'">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'J')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:when test="$char = '#'">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'G')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:when test="$char = '('">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'O')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:when test="$char = ')'">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'C')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,$char)"/>
-     </xsl:call-template>
-    </xsl:otherwise>
-   </xsl:choose>
-  </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- The next function is used to quote URIs to embed them in an URL -->
-<xsl:template name="quote_url">
- <xsl:param name="s" select="''"/>
- <xsl:param name="news" select="''"/>
- <xsl:choose>
-  <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
-  <xsl:otherwise>
-   <xsl:variable name="char" select="substring($s,1,1)"/>
-   <xsl:choose>
-    <xsl:when test="$char = '#'">
-     <xsl:call-template name="quote_url">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,'%23')"/>
-     </xsl:call-template>
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:call-template name="quote_url">
-      <xsl:with-param name="s" select="substring($s,2)"/>
-      <xsl:with-param name="news" select="concat($news,$char)"/>
-     </xsl:call-template>
-    </xsl:otherwise>
-   </xsl:choose>
-  </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="RDFURI_of_CICURI">
- <xsl:param name="uri" select="''"/>
- <xsl:variable name="before" select="substring-before($uri,'#xpointer(1/')"/>
- <xsl:value-of select="$base_RDF_URI"/>
- <xsl:choose>
-  <xsl:when test="$before=''">
-   <xsl:value-of select="$uri"/>
-  </xsl:when>
-  <xsl:otherwise>
-   <xsl:value-of select="concat($before,',')"/>
-   <xsl:variable name="after" select="substring-after($uri,'#xpointer(1/')"/>
-   <xsl:value-of select="translate(substring-before($after,')'),'/',',')"/>
-  </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:text>strict digraph L0 { size = "83,83"; node [style=filled, shape = box];&CSCbr;</xsl:text>
- <xsl:variable name="quoted_CICURI">
-  <xsl:call-template name="quote_url">
-   <xsl:with-param name="s" select="$CICURI"/>
-  </xsl:call-template>
- </xsl:variable>
- <!-- The nonce is used to force the document reload -->
- <xsl:variable name="dummy0" select="document(concat($uri_set_queueURL,'set_uri_set_size?uri=',$quoted_CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID,'&amp;size=',$uri_set_size))"/>
- <xsl:variable name="dummy1" select="document(concat($uri_set_queueURL,'add_if_not_in?uri=',$quoted_CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
- <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$quoted_CICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
- <xsl:variable name="dummy2" select="document(concat($uri_set_queueURL,'reset_to_empty?PID=',$PID))"/>
- <xsl:text>}</xsl:text>
-</xsl:template>
-
-<xsl:template mode="loop" match="empty"/>
-
-<xsl:template mode="loop" match="uri|marked_uri">
- <xsl:variable name="rdfuri">
-  <xsl:call-template name="RDFURI_of_CICURI">
-   <xsl:with-param name="uri" select="@value"/>
-  </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="document" select="document(concat($base_URL_of_URI,$rdfuri))"/>
- <xsl:choose>
-  <xsl:when test="$document/*">
-   <xsl:apply-templates mode="first_time" select="$document/*">
-    <xsl:with-param name="currentCICURI" select="@value"/>
-    <xsl:with-param name="quotedCurrentCICURI">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="@value"/>
-     </xsl:call-template>
-    </xsl:with-param>
-    <xsl:with-param name="do_not_visit" select="name(.)"/>
-   </xsl:apply-templates>
-  </xsl:when>
-  <xsl:otherwise>
-   <xsl:apply-templates mode="first_time" select=".">
-    <xsl:with-param name="currentCICURI" select="@value"/>
-    <xsl:with-param name="quotedCurrentCICURI">
-     <xsl:call-template name="quote">
-      <xsl:with-param name="s" select="@value"/>
-     </xsl:call-template>
-    </xsl:with-param>
-    <xsl:with-param name="do_not_visit" select="'no_deps'"/>
-   </xsl:apply-templates>
-  </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="quoted_value">
-  <xsl:call-template name="quote_url">
-   <xsl:with-param name="s" select="@value"/>
-  </xsl:call-template>
- </xsl:variable>
- <!-- The couple (uri,nonce) is used to force the document reload -->
- <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$quoted_value,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))"/>
-</xsl:template>
-
-
-<xsl:template mode="first_time" match="*">
- <xsl:param name="currentCICURI" select="''"/>
- <xsl:param name="quotedCurrentCICURI" select="''"/>
- <xsl:param name="do_not_visit" select="'uri'"/>
- <xsl:if test="$do_not_visit='uri'">
-  <xsl:apply-templates select=".">
-   <xsl:with-param name="currentCICURI" select="$currentCICURI"/>
-   <xsl:with-param name="quotedCurrentCICURI" select="$quotedCurrentCICURI"/>
-  </xsl:apply-templates>
- </xsl:if>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$quotedCurrentCICURI"/>
-<!-- <xsl:text> [fontname="LucidaSansRegular",color=red,label="</xsl:text> -->
- <xsl:text> [label="</xsl:text>
- <xsl:value-of select="$currentCICURI"/>
- <xsl:text>",URL="</xsl:text>
- <xsl:value-of select="$currentCICURI"/>
- <xsl:text>"</xsl:text>
- <xsl:if test="name(document(concat($uri_set_queueURL,'is_overflowed?uri=',$quotedCurrentCICURI,'&amp;nonce=',generate-id(),'&amp;PID=',$PID))/*)='true'">
-  <xsl:text>,color=red</xsl:text>
- </xsl:if>
- <xsl:text>];&CSCbr;</xsl:text>
-</xsl:template>
-
-<xsl:template match="*">
- <xsl:param name="currentCICURI" select="''"/>
- <xsl:param name="quotedCurrentCICURI" select="''"/>
- <xsl:for-each select="*/*/*">
-  <xsl:variable name="quotedURI">
-   <xsl:call-template name="quote">
-    <xsl:with-param name="s" select="@rdf:value"/>
-   </xsl:call-template>
-  </xsl:variable>
-  <xsl:variable name="quoted_uri">
-   <xsl:call-template name="quote_url">
-    <xsl:with-param name="s" select="@rdf:value"/>
-   </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=',$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>
-   <xsl:value-of select="$quotedURI"/>
-   <xsl:value-of select="$link_direction"/>
-   <xsl:text>;&CSCbr;</xsl:text>
-  </xsl:if>
- </xsl:for-each>
-</xsl:template>
-
-</xsl:stylesheet>