<!--******************************************************************-->
<!-- Parameters containing the absolute path of the CIC file -->
<!--******************************************************************-->
-<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
-<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
-<!-- 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="naturalLanguage" select="'yes'"/>
-<xsl:param name="annotations" select="'no'"/>
-<xsl:param name="media-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:variable name="absPath"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:variable>
-
-<xsl:variable name="header"><xsl:value-of select="$processorURL"/>apply?keys=<xsl:value-of select="$thkeys"/>&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.annotations=<xsl:value-of select="$annotations"/>&prop.media-type=<xsl:value-of select="$media-type"/>&prop.doctype-public=<xsl:value-of select="$doctype-public"/>&prop.encoding=<xsl:value-of select="$encoding"/>&param.keys=<xsl:value-of select="$keys"/>&param.getterURL=<xsl:value-of select="$getterURL"/>&param.processorURL=<xsl:value-of select="$processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
+<xsl:import href="links_library.xsl"/>
<xsl:output
method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="DTD/xhtml1-transitional.dtd" />
-<!-- Generates an url from an uri -->
-<!-- DUPLICATO in content_to_html!! -->
-
-<xsl:template name="makeURL">
-<xsl:param name="type" select="0"/>
-<xsl:param name="uri" select="''"/>
- <xsl:value-of select="concat(string($header),string($uri),'&param.CICURI=',string($uri),'&param.type=',string($type))"/>
-</xsl:template>
-
<!-- THEORY CONTENT ELEMENTS -->
<!-- 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:call-template></xsl:variable>
+<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:copy>
<xsl:copy-of select="@*"/>
<!--<xsl:variable name="doc" select="document(string($url))"/>
</xsl:template>
<xsl:template match="AXIOM|DEFINITION|VARIABLE">
-<xsl:variable name="url"><xsl:call-template name="makeURL"><xsl:with-param name="type" select="0"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl: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: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:call-template></xsl:variable>
+<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:copy-of select="document(string($url))"/>
</xsl:template>
</xsl:template>
</xsl:stylesheet>
-
-
-
-
-
-
-
-
<!-- First draft: March 16 2001, Irene Schena -->
<!--***********************************************************************-->
-<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
-<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
-<xsl:param name="keys" select="'C1,HC2'"/>
-<xsl:param name="naturalLanguage" select="'yes'"/>
-<xsl:param name="annotations" select="'no'"/>
-<xsl:param name="media-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:variable name="absPath"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:variable>
-
-<xsl:variable name="header"><xsl:value-of select="$processorURL"/>apply?keys=<xsl:value-of select="$keys"/>&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.annotations=<xsl:value-of select="$annotations"/>&prop.media-type=<xsl:value-of select="$media-type"/>&prop.doctype-public=<xsl:value-of select="$doctype-public"/>&prop.encoding=<xsl:value-of select="$encoding"/>&param.keys=<xsl:value-of select="$keys"/>&param.getterURL=<xsl:value-of select="$getterURL"/>&param.processorURL=<xsl:value-of select="$processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
-
-<xsl:template name="makeURL">
-<xsl:param name="uri" select="''"/>
- <xsl:value-of select="concat(string($header),string($uri),'&param.CICURI=',string($uri))"/>
-</xsl:template>
+<xsl:import href="links_library.xsl"/>
<xsl:template match="*[@xlink:href]">
<xsl:copy>
</xsl:copy>
</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0"?>
+
+<!-- Copyright (C) 2000, HELM Team -->
+<!-- -->
+<!-- This file is part of HELM, an Hypertextual, Electronic -->
+<!-- Library of Mathematics, developed at the Computer Science -->
+<!-- Department, University of Bologna, Italy. -->
+<!-- -->
+<!-- HELM is free software; you can redistribute it and/or -->
+<!-- modify it under the terms of the GNU General Public License -->
+<!-- as published by the Free Software Foundation; either version 2 -->
+<!-- of the License, or (at your option) any later version. -->
+<!-- -->
+<!-- HELM is distributed in the hope that it will be useful, -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
+<!-- GNU General Public License for more details. -->
+<!-- -->
+<!-- You should have received a copy of the GNU General Public License -->
+<!-- along with HELM; if not, write to the Free Software -->
+<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
+<!-- MA 02111-1307, USA. -->
+<!-- -->
+<!-- For details, see the HELM World-Wide-Web page, -->
+<!-- http://cs.unibo.it/helm/. -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************-->
+<!-- auxiliary functions -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
+<!--***********************************************************************-->
+
+<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
+<xsl:param name="processorURL" select="'http://localhost:8080/helm/servlet/uwobo/'"/>
+<!-- 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="naturalLanguage" select="'yes'"/>
+<xsl:param name="annotations" select="'no'"/>
+<xsl:param name="media-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:variable name="absPath"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:variable>
+
+<!-- quote() escapes white-spaces with %20 -->
+<xsl:template name="quote">
+ <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="quote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select="concat($news,$char)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select="concat($news,'%20')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:variable name="escaped-doctype-public">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$doctype-public"/>
+ </xsl:call-template>
+</xsl:variable>
+
+<!-- makeURL() maps URIs into URLs -->
+
+<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="$getterURL"/>&param.processorURL=<xsl:value-of select="$processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
+
+<xsl:template name="makeURL">
+<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:template>
+
+</xsl:stylesheet>