of nodes.
// (use_rdf_uri==true) if the stylesheet must be applied to the
// metadata; (use_rdf_uri==false) otherwise
-function mkGraphURL(uri,keys,use_rdf_uri,use_default_uri_set_size)
+function mkGraphURL(uri,keys,use_rdf_uri)
{
var getterURL = unescape(getParam("param.getterURL"));
var draw_graphURL = unescape(getParam("param.draw_graphURL"));
url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' +
(use_rdf_uri ? rdfuri : removeXPointer(uri)));
url = setParam(url,"param.CICURI",escape(uri));
- var uri_set_size =
- use_default_uri_set_size ? -1 : document.uri_set_size.elements[0].value;
- if (uri_set_size > 0)
- url = setParam(url,"param.uri_set_size",uri_set_size);
+ var uri_set_size = document.uri_set_size.elements[0].value;
+ url = setParam(url,"param.uri_set_size",uri_set_size);
url = draw_graphURL + 'draw?url=' + escape(url);
var url2 = setParam(location.href,"keys","MGL,RT");
url2 = setParam(url2,"xmluri",escape(url));
- if (uri_set_size > 0)
- url2 = setParam(url2,"param.uri_set_size",uri_set_size);
+ url2 = setParam(url2,"param.uri_set_size",uri_set_size);
return url2;
}
-function mkDepURL(uri,use_default_uri_set_size)
+function mkDepURL(uri)
{
- return mkGraphURL(uri,"MDG",0,use_default_uri_set_size);
+ return mkGraphURL(uri,"MDG",0);
}
-function mkMetaURL(uri,use_default_uri_set_size)
+function mkMetaURL(uri)
{
- return mkGraphURL(uri,"MMG",1,use_default_uri_set_size);
+ return mkGraphURL(uri,"MMG",1);
}
function mkCICURL(uri)
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:subst="http://www.cs.unibo.it/helm/subst">
+<!--CSC: code cut & pasted also in metadataLib.xsl -->
<xsl:param name="uri_set_size" select="'30'"/>
+<!--CSC: end of cut & paste also in metadataLib.xsl -->
<xsl:output method="html" encoding="iso-8859-1"/>
</xsl:template>
<xsl:template match="body">
+ <!--CSC: end of cut & paste also in metadataLib.xsl -->
<form name="uri_set_size">
Number of nodes to show when following an hyperlink:
<input type="text" onClick="return false" value="{$uri_set_size}" size="2"/> (30 suggested)
</form>
+ <!--CSC: end of cut & paste also in metadataLib.xsl -->
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
[,,,
,,,,,,,,,,,,,,,,
1,true],
-["Objects this one depends on.","javascript:window.open(mkDepURL(selectedURI,false),'graph')",1,0,0],
+["Objects this one depends on.","javascript:window.open(mkDepURL(selectedURI),'graph')",1,0,0],
["Render this object.","javascript:window.open(mkCICURL(selectedURI),'cic')",1,0,0],
["Objects depending directly on this one.","javascript:window.open(mkMetaTheoryURL(selectedURI),'graph')",1,0,0],
-["Objects depending on this one.","javascript:window.open(mkMetaURL(selectedURI,false),'graph')",1,0,0]
+["Objects depending on this one.","javascript:window.open(mkMetaURL(selectedURI),'graph')",1,0,0]
];
]]>
</script>
<xsl:param name="getterURL" select="''"/>
<xsl:param name="draw_graphURL" select="''"/>
+<!--CSC: code cut & pasted from makeGraphLinks -->
+<xsl:param name="uri_set_size" select="'30'"/>
+<!--CSC: end of cut & paste from makeGraphLinks -->
+
<xsl:variable name="BaseRDFURL" select="concat($getterURL,'getxml?uri=helm:rdf:www.cs.unibo.it/helm/rdf/')"/>
<xsl:variable name="BaseRDFURLForward" select="concat($BaseRDFURL,'forward//')"/>
<xsl:variable name="BaseRDFURLBackward" select="concat($BaseRDFURL,'backward//')"/>
+<!-- Next function to quote strings for JavaScript (i.e. ' ==> \' -->
+<xsl:template name="jsquote">
+ <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="jsquote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select='concat($news,"\\\'")'/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="jsquote">
+ <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 match="/">
<html>
<head>
]]>
</script>
<xsl:apply-templates select="*"/>
+ <!--CSC: code almost cut & pasted from makeGraphLinks -->
+ <form name="uri_set_size">
+ Number of nodes to show when following an hyperlink to a graph:
+ <input type="text" onClick="return false" value="{$uri_set_size}" size="2"/> (30 suggested)
+ </form>
+ <!--CSC: end of cut & paste from makeGraphLinks -->
</body>
</html>
</xsl:template>
<xsl:param name="name" select="''"/>
<xsl:param name="CICURI" select="''"/>
<xsl:param name="RDFURI" select="''"/>
+ <xsl:variable name="quotedCICURI">
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="$CICURI"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:choose>
<xsl:when test="document(concat($BaseRDFURLBackward,$RDFURI))/*/*/*">
<p>
</p>
<p>
<script>
- var CICURI = "<xsl:value-of select="$CICURI"/>";
<![CDATA[
- document.write('<a target="graph" href="' + mkMetaURL(CICURI,true) + '">View the graph of all the objects depending on this one.</a>');
+ document.write('<a href="" onClick="window.open(mkMetaURL(\']]><xsl:value-of select="$quotedCICURI"/><![CDATA[\'),\'graph\');return false;">View the graph of all the objects depending on this one.</a>');
]]>
</script>
</p>
<p>
<!-- CSC: Cut & Paster from above ==> create a single javascript function -->
<script>
- var CICURI = "<xsl:value-of select="$CICURI"/>";
<![CDATA[
- document.write('<a target="graph" href="' + mkDepURL(CICURI,true) + '">View the graph of all the dependencies of this object.</a>');
+ document.write('<a href="" onClick="window.open(mkDepURL(\']]><xsl:value-of select="$quotedCICURI"/><![CDATA[\'),\'graph\');return false;">View the graph of all the dependencies of this object.</a>');
]]>
</script>
</p>