]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/expandobj.xsl
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / style / expandobj.xsl
index c8d9f33a099fa6df14bbb9274fde7de5e62acbf3..6c61823d871e180fee70c9a781984e523981da90 100644 (file)
 <!-- First draft: March 08 2001, Irene Schena                              -->
 <!--***********************************************************************--> 
 
-<xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
 
 <!--******************************************************************-->
 <!-- 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="'xhtml'"/>
-<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"/>&#x26;param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&#x26;param.annotations=<xsl:value-of select="$annotations"/>&#x26;prop.media-type=<xsl:value-of select="$media-type"/>&#x26;prop.doctype-public=<xsl:value-of select="$doctype-public"/>&#x26;prop.encoding=<xsl:value-of select="$encoding"/>&#x26;param.keys=<xsl:value-of select="$keys"/>&#x26;param.getterURL=<xsl:value-of select="$getterURL"/>&#x26;param.processorURL=<xsl:value-of select="$processorURL"/>&#x26;xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
 
+<xsl:import href="links_library.xsl"/>
 
 <xsl:output 
        method="xml"
@@ -59,30 +45,20 @@ step for expanding objects -->
        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),'&#x26;param.CICURI=',string($uri),'&#x26;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:template match="ht:THEOREM">
+<xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><xsl:with-param name="type" select="'typeonly'"/><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:value-of select="$doc"/>-->
     <xsl:copy-of select="document(string($url))"/>
+    <xsl:value-of select="$url"/>
    </xsl:copy>
 </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:template match="ht:AXIOM|ht:DEFINITION|ht:VARIABLE">
+<xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><xsl:with-param name="type" select="'embed'"/><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))"/>
@@ -92,8 +68,9 @@ step for expanding objects -->
 <!-- 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:copy-of select="document(string($url))"/>
+<xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><xsl:with-param name="type" select="@type"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl:variable>
+  <xsl:variable name="doc_to_embed" select="document(string($url))/to_be_embedded"/>
+  <xsl:copy-of select="$doc_to_embed/*|$doc_to_embed/text()"/>
 </xsl:template>
 
 <!-- CONTENT AND PRESENTATION THEORY AND SUBTHEORY -->
@@ -106,11 +83,3 @@ step for expanding objects -->
 </xsl:template>
 
 </xsl:stylesheet>
-
-
-
-
-
-
-
-