<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
<!--***********************************************************************-->
+<!-- * is used for objects -->
+<!-- th* is used for theories -->
+<!-- embed* is used for objects embedded in theories -->
+
<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
+<xsl:param name="draw_graphURL" select="'http://localhost:8083/'"/>
+<xsl:param name="uri_set_queueURL" select="'http://localhost:8084/'"/>
+<xsl:param name="proofcheckerURL" select="'http://localhost:48084/'"/>
+<!-- URL to the frameset (control + output) -->
+<xsl:param name="topurl" select="''"/>
<xsl:param name="interfaceURL" select="''"/>
<xsl:param name="thinterfaceURL" select="''"/>
-<!-- Keys contains the keys of the stylesheets to be applied following links-->
+
<xsl:param name="keys" select="'C1,HC2,L'"/>
-<!-- Thkeys contains the keys of the stylesheets to be applied at the first
-step for expanding objects -->
-<xsl:param name="thkeys" select="'TC1,HC2,L'"/>
+<xsl:param name="embedkeys" select="'TC1,HC2,L'"/>
+<xsl:param name="thkeys" select="'T1,T2,L,E'"/>
+
<xsl:param name="naturalLanguage" select="'yes'"/>
<xsl:param name="annotations" select="'no'"/>
+<xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
+
<xsl:param name="media-type" select="'text/html'"/>
+<xsl:param name="thmedia-type" select="'text/html'"/>
<xsl:param name="doctype-public" select="'-//W3C//DTD XHTML 1.0 Transitional//EN'"/>
<xsl:param name="encoding" select="'iso-8859-1'"/>
+<xsl:param name="thencoding" select="'iso-8859-1'"/>
+
<xsl:template name="quote">
<xsl:param name="s" select="''"/>
<xsl:with-param name="news" select="concat($news,'%2C')"/>
</xsl:call-template>
</xsl:when>
+<!--CSC: This breaks all the rest ;-)
+ <xsl:when test="$char = ':'">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select="concat($news,'%3A')"/>
+ </xsl:call-template>
+ </xsl:when>
+-->
<xsl:otherwise>
<xsl:call-template name="quote">
<xsl:with-param name="s" select="substring($s,2)"/>
</xsl:call-template>
</xsl:variable>
+<xsl:variable name="escaped-topurl">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$topurl"/>
+ </xsl:call-template>
+</xsl:variable>
+
<xsl:variable name="escaped-thinterfaceURL">
<xsl:call-template name="quote">
<xsl:with-param name="s" select="$thinterfaceURL"/>
<xsl:variable name="quotedthkeys">
<xsl:call-template name="quote">
- <xsl:with-param name="s" select="'T1,T2,L,E'"/>
+ <xsl:with-param name="s" select="$thkeys"/>
</xsl:call-template>
</xsl:variable>
-<xsl:variable name="quotedekeys">
+<xsl:variable name="quotedembedkeys">
<xsl:call-template name="quote">
- <xsl:with-param name="s" select="$thkeys"/>
+ <xsl:with-param name="s" select="$embedkeys"/>
</xsl:call-template>
</xsl:variable>
</xsl:call-template>
</xsl:variable>
+<xsl:variable name="quotedquotedembedkeys">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$quotedembedkeys"/>
+ </xsl:call-template>
+</xsl:variable>
+
<xsl:variable name="header0"><xsl:value-of select="$interfaceURL"/>?url=</xsl:variable>
<xsl:variable name="thheader0"><xsl:value-of select="$thinterfaceURL"/>?url=</xsl:variable>
<xsl:variable name="header1"><xsl:value-of select="$escaped-processorURL"/>apply?keys=</xsl:variable>
-<xsl:variable name="header2">&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.annotations=<xsl:value-of select="$annotations"/>&prop.media-type=<xsl:value-of select="$media-type"/>&param.media-type=<xsl:value-of select="$media-type"/>&prop.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&param.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&prop.encoding=<xsl:value-of select="$encoding"/>&param.encoding=<xsl:value-of select="$encoding"/>&param.keys=<xsl:value-of select="$quotedkeys"/>&param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&param.processorURL=<xsl:value-of select="$escaped-processorURL"/>&param.interfaceURL=<xsl:value-of select="$escaped-interfaceURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
-<xsl:variable name="header3">&param.thkeys=<xsl:value-of select="$quotedekeys"/>&param.thinterfaceURL=<xsl:value-of select="$escaped-thinterfaceURL"/></xsl:variable>
+<xsl:variable name="bothheader2">&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.proofcheckerURL=<xsl:value-of select="$proofcheckerURL"/>&param.draw_graphURL=<xsl:value-of select="$draw_graphURL"/>&param.uri_set_queueURL=<xsl:value-of select="$uri_set_queueURL"/>&param.UNICODEvsSYMBOL=<xsl:value-of select="$UNICODEvsSYMBOL"/>&param.annotations=<xsl:value-of select="$annotations"/>&prop.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&param.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&param.encoding=<xsl:value-of select="$encoding"/>&param.media-type=<xsl:value-of select="$media-type"/>&param.keys=<xsl:value-of select="$quotedkeys"/>&param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&param.processorURL=<xsl:value-of select="$escaped-processorURL"/>&param.interfaceURL=<xsl:value-of select="$escaped-interfaceURL"/>&param.topurl=<xsl:value-of select="$escaped-topurl"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
+<xsl:variable name="header2">&prop.media-type=<xsl:value-of select="$media-type"/>&prop.encoding=<xsl:value-of select="$encoding"/></xsl:variable>
+<xsl:variable name="thheader2">&prop.media-type=<xsl:value-of select="$thmedia-type"/>&param.thmedia-type=<xsl:value-of select="$thmedia-type"/>&param.thkeys=<xsl:value-of select="$quotedthkeys"/>&param.embedkeys=<xsl:value-of select="$quotedembedkeys"/>&param.thinterfaceURL=<xsl:value-of select="$escaped-thinterfaceURL"/>&param.thencoding=<xsl:value-of select="$thencoding"/>&prop.encoding=<xsl:value-of select="$thencoding"/></xsl:variable>
<xsl:variable name="quotedheader1">
<xsl:call-template name="quote">
</xsl:call-template>
</xsl:variable>
+<xsl:variable name="quotedbothheader2">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$bothheader2"/>
+ </xsl:call-template>
+</xsl:variable>
+
<xsl:variable name="quotedheader2">
<xsl:call-template name="quote">
<xsl:with-param name="s" select="$header2"/>
</xsl:call-template>
</xsl:variable>
-<xsl:variable name="quotedheader3">
+<xsl:variable name="quotedthheader2">
<xsl:call-template name="quote">
- <xsl:with-param name="s" select="$header3"/>
+ <xsl:with-param name="s" select="$thheader2"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$quotedheader1"/>
<xsl:value-of select="$quotedquotedkeys"/>
<xsl:value-of select="$quotedheader2"/>
+ <xsl:value-of select="$quotedbothheader2"/>
</xsl:variable>
<xsl:variable name="biquotedthfixedheader">
<xsl:value-of select="$thheader0"/>
<xsl:value-of select="$quotedheader1"/>
<xsl:value-of select="$quotedquotedthkeys"/>
- <xsl:value-of select="$quotedheader2"/>
+ <xsl:value-of select="$quotedthheader2"/>
+ <xsl:value-of select="$quotedbothheader2"/>
</xsl:variable>
-<!-- NOTE: thkeys are propagated, but we are sure (for now!!!) that -->
-<!-- they won't never be used. -->
-<!-- type, instead, is not propagated -->
+<!-- NOTE: embedkeys and thkeys are propagated, but we are sure that -->
+<!-- they won't never be used. -->
+<!--CSC: fixare il punto sopra!!! -->
+<!-- type, instead, is not propagated -->
<xsl:template name="makeURL">
<xsl:param name="uri" select="''"/>
+ <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
+ <xsl:variable name="cleanuri">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">
+ <xsl:value-of select="substring-before($uri,'#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$uri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sharpsuffix">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:value-of select="$biquotedfixedheader"/>
- <xsl:value-of select="$uri"/>%26param.CICURI%3D<xsl:value-of select="$uri"/>
+ <xsl:value-of select="$cleanuri"/>%26param.CICURI%3D<xsl:value-of select="$cleanuri"/>
+ <xsl:value-of select="$sharpsuffix"/>
</xsl:template>
+
<xsl:template name="makeTheoryURL">
<xsl:param name="uri" select="''"/>
+ <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
+ <xsl:variable name="cleanuri">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">
+ <xsl:value-of select="substring-before($uri,'#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$uri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sharpsuffix">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:value-of select="$biquotedthfixedheader"/>
- <xsl:value-of select="$uri"/>%26param.CICURI%3D<xsl:value-of select="$uri"/>
- <xsl:value-of select="$quotedheader3"/>
+ <xsl:value-of select="$cleanuri"/>%26param.CICURI%3D<xsl:value-of select="$cleanuri"/>
+ <xsl:value-of select="$sharpsuffix"/>
</xsl:template>
<!-- makeURL4embedding() maps URIs into URLs -->
<xsl:template name="makeURL4embedding">
<xsl:param name="uri" select="''"/>
-<xsl:param name="type" select="0"/>
+<xsl:param name="type" select="'standalone'"/>
+ <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
+ <xsl:variable name="cleanuri">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">
+ <xsl:value-of select="substring-before($uri,'#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$uri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sharpsuffix">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:value-of select="$header1"/>
- <xsl:value-of select="$quotedekeys"/>
+ <xsl:value-of select="$quotedembedkeys"/>
<xsl:value-of select="$header2"/>
- <xsl:value-of select="$uri"/>&param.CICURI=<xsl:value-of select="$uri"/>&param.type=<xsl:value-of select="$type"/>
+ <xsl:value-of select="$bothheader2"/>
+ <xsl:value-of select="$cleanuri"/>&param.CICURI=<xsl:value-of select="$cleanuri"/>&param.type=<xsl:value-of select="$type"/><xsl:value-of select="$sharpsuffix"/>
</xsl:template>
-</xsl:stylesheet>
-
+<!-- makeURL4InnerTypes() maps URIs into URLs -->
+<!-- The target of the URL is only the processed document -->
+<xsl:template name="makeURL4InnerTypes">
+<xsl:param name="uri" select="''"/>
+ <xsl:variable name="uri_after_sharp" select="substring-after($uri,'#')"/>
+ <xsl:variable name="cleanuri">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">
+ <xsl:value-of select="substring-before($uri,'#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$uri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="sharpsuffix">
+ <xsl:choose>
+ <xsl:when test="$uri_after_sharp">%23<xsl:value-of select="$uri_after_sharp"/></xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$header1"/>d_c&param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&param.CICURI=<xsl:value-of select="$cleanuri"/>&xmluri=<xsl:value-of select="$absPath"/><xsl:value-of select="$cleanuri"/>
+ <xsl:value-of select="$sharpsuffix"/>
+</xsl:template>
+</xsl:stylesheet>