3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <!-- CSC: Sostituire l'andata a capo con la entity numerica opportuna -->
33 <xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
34 xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
36 <xsl:output method="text"/>
38 <xsl:param name="CICURI" select="''"/>
39 <xsl:param name="PID" select="''"/>
40 <xsl:param name="maxDepth" select="5"/>
41 <xsl:param name="getterURL" select="''"/>
42 <xsl:variable name="RDF_base_URL_of_CIC_URI" select="concat($getterURL,'getxml?uri=helm:rdf:www.cs.unibo.it/helm/rdf/rdfprova//')"/>
44 <!-- CSC: next function because I don't remember the name of the -->
45 <!-- CSC: subst function of xslt and I don't have the specs with me -->
46 <xsl:template name="quote">
47 <xsl:param name="s" select="''"/>
48 <xsl:param name="news" select="''"/>
50 <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
52 <xsl:variable name="char" select="substring($s,1,1)"/>
54 <xsl:when test="$char = '/'">
55 <xsl:call-template name="quote">
56 <xsl:with-param name="s" select="substring($s,2)"/>
57 <xsl:with-param name="news" select="concat($news,'X')"/>
60 <xsl:when test="$char = ':'">
61 <xsl:call-template name="quote">
62 <xsl:with-param name="s" select="substring($s,2)"/>
63 <xsl:with-param name="news" select="concat($news,'Y')"/>
66 <xsl:when test="$char = '.'">
67 <xsl:call-template name="quote">
68 <xsl:with-param name="s" select="substring($s,2)"/>
69 <xsl:with-param name="news" select="concat($news,'Z')"/>
72 <xsl:when test='$char = "'"'>
73 <xsl:call-template name="quote">
74 <xsl:with-param name="s" select="substring($s,2)"/>
75 <xsl:with-param name="news" select="concat($news,'W')"/>
78 <xsl:when test="$char = '-'">
79 <xsl:call-template name="quote">
80 <xsl:with-param name="s" select="substring($s,2)"/>
81 <xsl:with-param name="news" select="concat($news,'J')"/>
85 <xsl:call-template name="quote">
86 <xsl:with-param name="s" select="substring($s,2)"/>
87 <xsl:with-param name="news" select="concat($news,$char)"/>
95 <xsl:template match="/">
96 <!-- dep_url_scheme -->
97 <xsl:text>http://localhost:8083/draw?url=http%3A//localhost%3A8080/helm/servlet/uwobo/apply%3Fxmluri%3Dhttp%3A//localhost%3A8081/getxml%253Furi%253D</xsl:text><xsl:value-of select="'#uri#'"/><xsl:text>%26keys%3DMDG%26param.getterURL%3Dhttp%253A//localhost%253A8081/%26prop.media-type%3Dtext/plain%26param.CICURI%3D</xsl:text><xsl:value-of select="'#uri#'"/><xsl:text>&CSCbr;</xsl:text>
98 <!-- meta_url_scheme -->
99 <xsl:text>http://localhost:8083/draw?url=http%3A%2F%2Flocalhost%3A8080%2Fhelm%2Fservlet%2Fuwobo%2Fapply%3Fxmluri%3Dhttp%3A%2F%2Flocalhost%3A8081%2Fgetxml%253Furi%253Dhelm%3Ardf%3Awww%2Ecs%2Eunibo.it/helm/rdf/rdfprova//</xsl:text><xsl:value-of select="'#uri#'"/><xsl:text>%26keys%3DMMG%26param.getterURL%3Dhttp%253A//localhost%253A8081/%26prop.media-type%3Dtext/plain%26param.CICURI%3D</xsl:text><xsl:value-of select="'#uri#'"/><xsl:text>%26keys%3DMMG%26param%2EgetterURL%3Dhttp%253A%2F%2Flocalhost%253A8081%2F%26prop%2Emedia%2Dtype%3Dtext%2Fplain%26param%2ECICURI%3D</xsl:text><xsl:value-of select="'#uri#'"/><xsl:text>&CSCbr;</xsl:text>
100 <!-- cic_url_scheme -->
101 <xsl:text>file:///projects/helm/on-line/html/cic/index.html?url=http://localhost:8080/helm/servlet/uwobo/apply%3Fkeys%3DC1%252CHC2%252CL%26prop.media-type%3Dtext/html%26prop.encoding%3Diso-8859-1%26param.naturalLanguage%3Dyes%26param.UNICODEvsSYMBOL%3Dsymbol%26param.annotations%3DNO%26prop.doctype-public%3D-//W3C//DTD%2520XHTML%25201.0%2520Transitional//EN%26param.doctype-public%3D-//W3C//DTD%2520XHTML%25201.0%2520Transitional//EN%26param.encoding%3Diso-8859-1%26param.media-type%3Dtext/html%26param.keys%3DC1%252CHC2%252CL%26param.getterURL%3Dhttp://localhost:8081/%26param.processorURL%3Dhttp://localhost:8080/helm/servlet/uwobo/%26param.interfaceURL%3Dfile:///projects/helm/on-line/html/cic/index.html%26param.topurl%3Dfile:///projects/helm/on-line%26xmluri%3Dhttp://localhost:8081/getxml%253Furi%253D</xsl:text><xsl:value-of select="'#uri#'"/><xsl:text>%26param.CICURI%3D</xsl:text><xsl:value-of select="'#uri#'"/><xsl:text>&CSCbr;</xsl:text>
103 <xsl:text>strict digraph L0 { size = "83,83"; concentrate=true; node [style=filled, shape = box];&CSCbr;</xsl:text>
105 <xsl:text>strict digraph L0 { size = "83,83"; node [style=filled, shape = box];&CSCbr;</xsl:text>
106 <xsl:variable name="dummy1" select="document(concat('http://localhost:8084/add_if_not_in?uri=',$CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
107 <xsl:apply-templates mode="loop" select="document(concat('http://localhost:8084/get_next?uri=',$CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
108 <xsl:variable name="dummy2" select="document(concat('http://localhost:8084/reset_to_empty?PID=',$PID))"/>
109 <xsl:text>}</xsl:text>
112 <xsl:template mode="loop" match="empty"/>
114 <xsl:template mode="loop" match="uri|marked_uri">
115 <xsl:variable name="document" select="document(concat($RDF_base_URL_of_CIC_URI,@value))"/>
117 <xsl:when test="$document/*">
118 <xsl:apply-templates mode="first_time" select="$document/*">
119 <xsl:with-param name="currentCICURI" select="@value"/>
120 <xsl:with-param name="quotedCurrentCICURI">
121 <xsl:call-template name="quote">
122 <xsl:with-param name="s" select="@value"/>
125 <xsl:with-param name="do_not_visit" select="name(.)"/>
126 </xsl:apply-templates>
129 <xsl:apply-templates mode="first_time" select=".">
130 <xsl:with-param name="currentCICURI" select="@value"/>
131 <xsl:with-param name="quotedCurrentCICURI">
132 <xsl:call-template name="quote">
133 <xsl:with-param name="s" select="@value"/>
136 <xsl:with-param name="do_not_visit" select="'no_deps'"/>
137 </xsl:apply-templates>
140 <!-- The couple (uri,nonce) is used to force the document reload -->
141 <xsl:apply-templates mode="loop" select="document(concat('http://localhost:8084/get_next?uri=',@value,'&nonce=',generate-id(),'&PID=',$PID))"/>
145 <xsl:template mode="first_time" match="*">
146 <xsl:param name="currentCICURI" select="''"/>
147 <xsl:param name="quotedCurrentCICURI" select="''"/>
148 <xsl:param name="do_not_visit" select="'uri'"/>
149 <xsl:text> </xsl:text>
150 <xsl:value-of select="$quotedCurrentCICURI"/>
151 <!-- <xsl:text> [fontname="LucidaSansRegular",color=red,label="</xsl:text> -->
152 <xsl:text> [label="</xsl:text>
153 <xsl:value-of select="$currentCICURI"/>
154 <xsl:text>",URL="</xsl:text>
155 <xsl:value-of select="$currentCICURI"/>
156 <xsl:text>"</xsl:text>
157 <xsl:if test="$do_not_visit='marked_uri'">
158 <xsl:text>,color=red</xsl:text>
160 <xsl:text>];&CSCbr;</xsl:text>
161 <xsl:if test="$do_not_visit='uri'">
162 <xsl:apply-templates select=".">
163 <xsl:with-param name="maxDepth" select="$newMaxDepth"/>
164 <xsl:with-param name="currentCICURI" select="$currentCICURI"/>
165 <xsl:with-param name="quotedCurrentCICURI" select="$quotedCurrentCICURI"/>
166 </xsl:apply-templates>
170 <xsl:template match="occurs">
171 <xsl:param name="maxDepth" select="''"/>
172 <xsl:param name="currentCICURI" select="''"/>
173 <xsl:param name="quotedCurrentCICURI" select="''"/>
174 <xsl:for-each select="*">
175 <xsl:variable name="quotedURI">
176 <xsl:call-template name="quote">
177 <xsl:with-param name="s" select="@uri"/>
180 <xsl:text> </xsl:text>
181 <xsl:value-of select="$quotedCurrentCICURI"/>
182 <xsl:text> -> </xsl:text>
183 <xsl:value-of select="$quotedURI"/>
184 <xsl:text>;&CSCbr;</xsl:text>
185 <!-- The nonce is used to force the document reload -->
186 <xsl:variable name="dummy" select="document(concat('http://localhost:8084/add_if_not_in?uri=',@uri,'&nonce=',generate-id(),'&PID=',$PID))"/>