]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/metadataLib.xsl
Oooops. I have exchanged the targets of the links to the graphs of
[helm.git] / helm / on-line / xslt / metadataLib.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0"
4  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5  xmlns:subst="http://www.cs.unibo.it/helm/subst">
6
7 <xsl:param name="CICURI" select="''"/>
8 <xsl:param name="getterURL" select="''"/>
9 <xsl:param name="draw_graphURL" select="''"/>
10
11 <xsl:variable name="BaseRDFURL" select="concat($getterURL,'getxml?uri=helm:rdf:www.cs.unibo.it/helm/rdf/')"/>
12 <xsl:variable name="BaseRDFURLForward" select="concat($BaseRDFURL,'forward//')"/>
13 <xsl:variable name="BaseRDFURLBackward" select="concat($BaseRDFURL,'backward//')"/>
14
15 <xsl:template match="/">
16  <html>
17   <head>
18    <subst:script language="JavaScript" src="/javascript/defaults.js"/>
19    <subst:script language="JavaScript" src="/javascript/utils.js"/>
20    <subst:script language="JavaScript" src="/javascript/control.js"/>
21    <subst:script language="JavaScript" src="/javascript/graphLinks.js"/>
22
23    <title>Metadata of <xsl:value-of select="$CICURI"/></title>
24   </head>
25   <body onLoad="window.focus()" bgColor="white">
26    <script>
27      var CICURI = "<xsl:value-of select="$CICURI"/>";
28 <![CDATA[
29      document.write('<h1>Metadata of <a target="cic" href="' + mkCICURL(CICURI) + '">' + CICURI + '</a></h1>');
30 ]]>
31    </script>
32    <xsl:apply-templates select="*"/>
33   </body>
34  </html>
35 </xsl:template>
36
37 <xsl:template name="makelink">
38  <xsl:param name="name" select="''"/>
39  <xsl:param name="CICURI" select="''"/>
40  <xsl:param name="RDFURI" select="''"/>
41  <xsl:choose>
42   <xsl:when test="document(concat($BaseRDFURLBackward,$RDFURI))/*/*/*">
43    <p>
44     <script>
45      var RDFURI = "helm:rdf:www.cs.unibo.it/helm/rdf/backward//<xsl:value-of select="$RDFURI"/>";
46      var getterURL = "<xsl:value-of select="$getterURL"/>";
47 <![CDATA[
48      var url = setParam(location.href,"keys","meta_theory%2CT1%2CT2%2CL%2CE");
49      url = setParam(url,"xmluri", getterURL + "getxml%3Furi%3D" + RDFURI);
50      document.write('<a target="theory" href="' + url + '">View the objects depending on it.</a>');
51 ]]>
52     </script>
53    </p>
54    <p>
55     <script>
56      var CICURI = "<xsl:value-of select="$CICURI"/>";
57 <![CDATA[
58      document.write('<a target="graph" href="' + mkMetaURL(CICURI,true) + '">View the graph of all the objects depending on this one.</a>');
59 ]]>
60     </script>
61    </p>
62   </xsl:when>
63   <xsl:otherwise>
64    <p>
65     Object <xsl:value-of select="$name"/> is never referenced in other objects
66    </p>
67   </xsl:otherwise>
68  </xsl:choose>
69
70  <xsl:choose>
71   <xsl:when test="document(concat($BaseRDFURLForward,$RDFURI))/*/*/*">
72    <p>
73     <!-- CSC: Cut & Paster from above ==> create a single javascript function -->
74     <script>
75      var CICURI = "<xsl:value-of select="$CICURI"/>";
76 <![CDATA[
77      document.write('<a target="graph" href="' + mkDepURL(CICURI,true) + '">View the graph of all the dependencies of this object.</a>');
78 ]]>
79     </script>
80    </p>
81   </xsl:when>
82   <xsl:otherwise>
83    <p>
84     Object <xsl:value-of select="$name"/> does not reference any other object
85    </p>
86   </xsl:otherwise>
87  </xsl:choose>
88 </xsl:template>
89
90 </xsl:stylesheet>