<!-- document cannot return HTML, transforming it into XML!!! -->
<xsl:template match="THEOREM|LEMMA|COROLLARY|FACT">
-<xsl:variable name="url"><xsl:call-template name="makeURL"><xsl:with-param name="type" select="1"/><xsl:with-param name="uri" select="@uri"/><xsl:with-param name="theory" select="'yes'"/></xsl:call-template></xsl:variable>
+<xsl:variable name="url"><xsl:call-template name="makeTheoryURL"><xsl:with-param name="type" select="1"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
<xsl:copy>
<xsl:copy-of select="@*"/>
<!--<xsl:variable name="doc" select="document(string($url))"/>
</xsl:template>
<xsl:template match="AXIOM|DEFINITION|VARIABLE">
-<xsl:param name="type" select="0"/><xsl:variable name="url"><xsl:call-template name="makeURL"><xsl:with-param name="type" select="0"/><xsl:with-param name="uri" select="@uri"/><xsl:with-param name="theory" select="'yes'"/></xsl:call-template></xsl:variable>
+<xsl:param name="type" select="0"/><xsl:variable name="url"><xsl:call-template name="makeTheoryURL"><xsl:with-param name="type" select="0"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="document(string($url))"/>
<!-- THEORY PRESENTATION ELEMENTS -->
<xsl:template match="ENTITY">
-<xsl:variable name="url"><xsl:call-template name="makeURL"><xsl:with-param name="type" select="@type"/><xsl:with-param name="uri" select="@uri"/><xsl:with-param name="theory" select="'yes'"/></xsl:call-template></xsl:variable>
+<xsl:variable name="url"><xsl:call-template name="makeTheoryURL"><xsl:with-param name="type" select="@type"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
<xsl:copy-of select="document(string($url))"/>
</xsl:template>
<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
+<xsl:param name="interfaceURL" 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
<xsl:with-param name="news" select="concat($news,'%3F')"/>
</xsl:call-template>
</xsl:when>
+ <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,'%3D')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <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,'%25')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <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,'%2C')"/>
+ </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>
-<!-- makeURL() maps URIs into URLs -->
+<xsl:variable name="escaped-interfaceURL">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$interfaceURL"/>
+ </xsl:call-template>
+</xsl:variable>
+
+<xsl:variable name="quotedthkeys">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$thkeys"/>
+ </xsl:call-template>
+</xsl:variable>
+
+<xsl:variable name="quotedquotedthkeys">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$quotedkeys"/>
+ </xsl:call-template>
+</xsl:variable>
+
+<xsl:variable name="quotedkeys">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$keys"/>
+ </xsl:call-template>
+</xsl:variable>
-<xsl:variable name="header1"><xsl:value-of select="$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="$keys"/>&param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&param.processorURL=<xsl:value-of select="$escaped-processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
+<xsl:variable name="header0"><xsl:value-of select="$interfaceURL"/>?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="quotedheader1">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$header1"/>
+ </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>
+
+<!-- makeURL() maps URIs into URLs -->
+<!-- The target of the URL is the whole frameset -->
+
+<xsl:variable name="biquotedfixedheader">
+ <xsl:value-of select="$header0"/>
+ <xsl:value-of select="$quotedheader1"/>
+ <xsl:value-of select="$quotedquotedthkeys"/>
+ <xsl:value-of select="$quotedheader2"/>
+</xsl:variable>
+
+<!-- NOTE: thkeys are propagated, but we are sure (for now!!!) that -->
+<!-- they won't never be used. -->
+<!-- type, instead, is not propagated -->
<xsl:template name="makeURL">
+<xsl:param name="uri" select="''"/>
+ <xsl:value-of select="$biquotedfixedheader"/>
+ <xsl:value-of select="$uri"/>%26param.CICURI%3D<xsl:value-of select="$uri"/>
+</xsl:template>
+
+<!-- makeTheoryURL() maps URIs into URLs -->
+<!-- The target of the URL is only the processed document -->
+
+<xsl:template name="makeTheoryURL">
<xsl:param name="uri" select="''"/>
<xsl:param name="type" select="0"/>
-<xsl:param name="theory" select="'no'"/>
- <xsl:variable name="mythkeys">
- <xsl:choose>
- <xsl:when test="$theory = 'yes'"><xsl:value-of select="$thkeys"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$keys"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat(string($header1),string($mythkeys),string($header2),string($uri),'&param.CICURI=',string($uri),'&param.type=',string($type))"/>
+ <xsl:value-of select="$header1"/>
+ <xsl:value-of select="$quotedthkeys"/>
+ <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:template>
</xsl:stylesheet>