]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/metadataLib.xsl
First implementation of graphs. Working on my notebook, probably not
[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
10 <xsl:template match="/">
11  <html>
12   <head>
13    <subst:script language="JavaScript" src="/javascript/defaults.js"/>
14    <subst:script language="JavaScript" src="/javascript/utils.js"/>
15    <subst:script language="JavaScript" src="/javascript/control.js"/>
16    <title>Metadata of <xsl:value-of select="$CICURI"/></title>
17   </head>
18   <body onLoad="window.focus()" bgColor="white">
19    <h1>Metadata of <xsl:value-of select="$CICURI"/></h1>
20    <xsl:apply-templates select="*"/>
21   </body>
22  </html>
23 </xsl:template>
24
25 <xsl:template match="/" mode="makelink">
26  <xsl:param name="name" select="''"/>
27  <xsl:param name="RDFURI" select="''"/>
28  <xsl:apply-templates select="*" mode="makelink">
29   <xsl:with-param name="name" select="$name"/>
30   <xsl:with-param name="RDFURI" select="$RDFURI"/>
31  </xsl:apply-templates>
32 </xsl:template>
33
34 <xsl:template match="unresolved" mode="makelink">
35  <xsl:param name="name" select="''"/>
36  <p>
37   Object <xsl:value-of select="$name"/> is never referenced in other objects
38  </p>
39  <xsl:apply-templates select="." mode="mk_dep_graph"/>
40 </xsl:template>
41
42 <xsl:template match="url" mode="makelink">
43  <xsl:param name="name" select="''"/>
44  <xsl:param name="RDFURI" select="''"/>
45  <p>
46   <script>
47    var RDFURI = "<xsl:value-of select="$RDFURI"/>";
48    var getterURL = "<xsl:value-of select="$getterURL"/>";
49 <![CDATA[
50    //url = setParam(url,"keys",getCICMathMLKeys());
51    var url = setParam(location.href,"keys","meta_theory%2CT1%2CT2%2CL%2CE");
52    url = setParam(url,"xmluri", getterURL + "getxml%3Furi%3D" + RDFURI);
53    document.write('<a target="theory" href="' + url + '">View the objects depending on it.</a>');
54 ]]>
55   </script>
56  </p>
57  <p>
58   <script>
59    var CICURI = "<xsl:value-of select="$CICURI"/>";
60 <![CDATA[
61    document.write('<a target="graph" href="http://localhost:8083/draw?url=' +
62     escape('http://localhost:8080/helm/servlet/uwobo/apply?xmluri=http://localhost:8081/getxml%3Furi%3D' + RDFURI + '&keys=MMG&param.getterURL=http%3A//localhost%3A8081/&prop.media-type=text/plain&param.CICURI=' + CICURI) + '">View the graph of all the objects dependending on this one.</a>');
63 ]]>
64   </script>
65  </p>
66  <xsl:apply-templates select="." mode="mk_dep_graph"/>
67 </xsl:template>
68
69 <xsl:template match="*" mode="mk_dep_graph">
70  <p>
71   <script>
72    var CICURI = "<xsl:value-of select="$CICURI"/>";
73 <![CDATA[
74    document.write('<a target="graph" href="http://localhost:8083/draw?url=' +
75     escape('http://localhost:8080/helm/servlet/uwobo/apply?xmluri=http://localhost:8081/getxml%3Furi%3D' + CICURI + '&keys=MDG&param.getterURL=http%3A//localhost%3A8081/&prop.media-type=text/plain&param.CICURI=' + CICURI) + '">View the graph of all the dependencies of this object.</a>');
76 ]]>
77   </script>
78  </p>
79 </xsl:template>
80
81 </xsl:stylesheet>