]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/resolve_topurl.xsl
Major interface improvements.
[helm.git] / helm / on-line / xslt / resolve_topurl.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                               xmlns:subst="http://www.cs.unibo.it/helm/subst">
5
6 <xsl:import href="links_library.xsl"/>
7 <xsl:import href="params.xsl"/>
8
9 <xsl:output
10            method="html" 
11            encoding="ISO-8859-1" 
12            media-type="text/html" />
13
14 <xsl:param name="proofcheckerURL" select="''"/>
15 <xsl:param name="interfaceURL" select="''"/>
16 <xsl:param name="processorURL" select="''"/>
17 <xsl:param name="getterURL" select="''"/>
18 <xsl:param name="draw_graphURL" select="''"/>
19 <xsl:param name="profile" select="''"/>
20 <xsl:param name="url" select="''"/>
21 <xsl:param name="CICURI" select="''"/>
22 <xsl:param name="annotations" select="''"/>
23
24 <xsl:template match="subst:script">
25  <xsl:copy-of select="document(concat($interfaceURL,@src,'_xml'))" />
26 </xsl:template>
27
28 <xsl:template match="subst:proofcheckerURL">
29  <xsl:value-of select="$proofcheckerURL"/>
30 </xsl:template>
31
32 <xsl:template match="subst:interfaceURL">
33  <xsl:value-of select="$interfaceURL"/>
34 </xsl:template>
35
36 <xsl:template match="subst:processorURL">
37  <xsl:value-of select="$processorURL"/>
38 </xsl:template>
39
40 <xsl:template match="subst:getterURL">
41  <xsl:value-of select="$getterURL"/>
42 </xsl:template>
43
44 <xsl:template match="subst:draw_graphURL">
45  <xsl:value-of select="$draw_graphURL"/>
46 </xsl:template>
47
48 <xsl:template match="subst:profile">
49  <xsl:value-of select="$profile"/>
50 </xsl:template>
51
52 <xsl:template match="subst:url">
53  <xsl:value-of select="$url"/>
54 </xsl:template>
55
56 <xsl:template match="subst:CICURL">
57  <xsl:call-template name="makeCICURL">
58   <xsl:with-param name="uri" select="$CICURI"/>
59  </xsl:call-template>
60 </xsl:template>
61
62 <xsl:template match="subst:HTMLURL">
63  <xsl:call-template name="makeHTMLURL">
64   <xsl:with-param name="uri" select="$CICURI"/>
65  </xsl:call-template>
66 </xsl:template>
67
68 <xsl:template match="subst:MathMLPresentationURL">
69  <xsl:call-template name="makeMathMLPresentationURL">
70   <xsl:with-param name="uri" select="$CICURI"/>
71  </xsl:call-template>
72 </xsl:template>
73
74 <xsl:template match="subst:MathMLContentURL">
75  <xsl:call-template name="makeMathMLContentURL">
76   <xsl:with-param name="uri" select="$CICURI"/>
77  </xsl:call-template>
78 </xsl:template>
79
80 <xsl:template match="subst:DirectRDFURL">
81  <xsl:call-template name="makeDirectRDFURL">
82   <xsl:with-param name="uri" select="$CICURI"/>
83  </xsl:call-template>
84 </xsl:template>
85
86 <xsl:template match="subst:InverseRDFURL">
87  <xsl:call-template name="makeInverseRDFURL">
88   <xsl:with-param name="uri" select="$CICURI"/>
89  </xsl:call-template>
90 </xsl:template>
91
92 <xsl:template match="subst:DCRDFURL">
93  <xsl:call-template name="makeDCRDFURL">
94   <xsl:with-param name="uri" select="$CICURI"/>
95  </xsl:call-template>
96 </xsl:template>
97
98 <xsl:template match="subst:CICURI">
99  <xsl:value-of select="$CICURI"/>
100 </xsl:template>
101
102 <xsl:template match="subst:base_CICURI">
103   <xsl:variable name="len" select="string-length($CICURI)" />
104   <xsl:variable name="extension">
105     <xsl:choose>
106       <xsl:when test="substring($CICURI,$len)='/'">#</xsl:when>
107       <xsl:when test="substring($CICURI,$len - 6)='.theory'">.theory</xsl:when>
108       <xsl:when test="substring($CICURI,$len - 3)='.con'">.con</xsl:when>
109       <xsl:when test="substring($CICURI,$len - 3)='.ind'">.ind</xsl:when>
110       <xsl:when test="substring($CICURI,$len - 3)='.var'">.var</xsl:when>
111       <xsl:when test="substring($CICURI,$len - 8)='.con.body'">.con.body</xsl:when>
112       <xsl:otherwise>
113 <!--
114         <xsl:message terminate="no">
115           resolve_topurl.xsl: assertion failed
116         </xsl:message>
117 -->
118       </xsl:otherwise>
119     </xsl:choose>
120   </xsl:variable>
121   <xsl:call-template name="name_of_uri">
122     <xsl:with-param name="uri">
123       <xsl:choose>
124         <xsl:when test="substring($CICURI,$len)='/'">
125           <xsl:value-of select="concat(substring($CICURI,1,$len - 1),'#')" />
126         </xsl:when>
127         <xsl:otherwise>
128           <xsl:value-of select="$CICURI" />
129         </xsl:otherwise>
130       </xsl:choose>
131     </xsl:with-param>
132     <xsl:with-param name="extension" select="$extension" />
133   </xsl:call-template>
134 </xsl:template>
135
136 <xsl:template match="subst:annotations">
137  <xsl:value-of select="$annotations"/>
138 </xsl:template>
139
140 <xsl:template match="subst:makeURL">
141  <xsl:call-template name="makeURL">
142   <xsl:with-param name="uri" select="$CICURI"/>
143   <xsl:with-param name="createframeset" select="false()"/>
144  </xsl:call-template>
145 </xsl:template>
146
147 <xsl:template match="subst:makeTheoryURL">
148  <xsl:call-template name="makeTheoryURL">
149   <xsl:with-param name="uri" select="$CICURI"/>
150   <xsl:with-param name="createframeset" select="false()"/>
151  </xsl:call-template>
152 </xsl:template>
153
154 <xsl:template match="subst:makeDirectDependencyURL">
155   <xsl:call-template name="makeDirectDependenciesURL">
156     <xsl:with-param name="uri" select="$CICURI"/>
157   </xsl:call-template>
158 </xsl:template>
159
160 <xsl:template match="subst:makeRecDependencyURL">
161   <xsl:call-template name="makeGraphURL">
162     <xsl:with-param name="uri" select="$CICURI"/>
163     <xsl:with-param name="keys" select="'MDG'"/>
164     <!-- <xsl:with-param name="uri_set_size" select="'document.uri_set_size.elements[0].value'"/> -->
165     <xsl:with-param name="uri_set_size" select="'30'"/>
166   </xsl:call-template>
167 </xsl:template>
168
169 <xsl:template match="subst:makeInverseDirectDependencyURL">
170   <xsl:call-template name="makeInverseDirectDependenciesURL">
171     <xsl:with-param name="uri" select="$CICURI"/>
172   </xsl:call-template>
173 </xsl:template>
174
175 <xsl:template match="subst:makeInverseRecDependencyURL">
176   <xsl:call-template name="makeGraphURL">
177     <xsl:with-param name="uri" select="$CICURI"/>
178     <xsl:with-param name="keys" select="'MMG'"/>
179     <!-- <xsl:with-param name="uri_set_size" select="'document.uri_set_size.elements[0].value'"/> -->
180     <xsl:with-param name="uri_set_size" select="'30'"/>
181   </xsl:call-template>
182 </xsl:template>
183
184 <xsl:template match="/|*">
185  <xsl:copy>
186   <xsl:copy-of select="@*"/>
187   <xsl:apply-templates/>
188  </xsl:copy>
189 </xsl:template>
190
191 </xsl:stylesheet>