In particular, now param.type may be 'standalone' or 'typeonly' or 'embed'.
(It was 0 or 1 before)
Modified Files:
content_to_html.xsl expandobj.xsl links_library.xsl
mmlextension.xsl objtheorycontent.xsl theory_content.xsl
theory_pres.xsl
<!--***********************************************************************-->
<xsl:param name="CICURI" select="''"/>
+<xsl:param name="type" select="'standalone'"/>
<xsl:include href="html_init.xsl"/>
<xsl:include href="html_set.xsl"/>
<xsl:variable name="framewidth" select="45"/>
<xsl:template match="/">
- <xsl:param name="current_indent" select="0"/>
+ <xsl:param name="current_indent" select="0"/>
+ <xsl:choose>
+ <xsl:when test="$type = 'standalone'">
<html>
<head>
<title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
</xsl:apply-templates>
</body>
</html>
+ </xsl:when>
+ <xsl:otherwise>
+ <to_be_embedded>
+ <xsl:apply-templates>
+ <xsl:with-param name="current_indent" select="0"/>
+ </xsl:apply-templates>
+ </to_be_embedded>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!--***********************************************************************-->
<!-- document cannot return HTML, transforming it into XML!!! -->
<xsl:template match="ht:THEOREM">
-<xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><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="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:copy>
</xsl:template>
<xsl:template match="ht:AXIOM|ht:DEFINITION|ht:VARIABLE">
-<xsl:param name="type" select="0"/><xsl:variable name="url"><xsl:call-template name="makeURL4embedding"><xsl:with-param name="type" select="0"/><xsl:with-param name="uri" select="@uri"/></xsl:call-template></xsl: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))"/>
<xsl:template match="ENTITY">
<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:copy-of select="document(string($url))"/>
+ <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 -->
</xsl:copy>
</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
<xsl:template name="makeURL4embedding">
<xsl:param name="uri" select="''"/>
-<xsl:param name="type" select="0"/>
+<xsl:param name="type" select="'standalone'"/>
<xsl:value-of select="$header1"/>
<xsl:value-of select="$quotedembedkeys"/>
<xsl:value-of select="$header2"/>
<!-- OBJECTS -->
<!--**********************-->
+<xsl:param name="type" select="'standalone'"/>
+
<xsl:template match="/">
- <!--
- <xsl:processing-instruction name="cocoon-format">type="text/xhtml"</xsl:processing-instruction>
- -->
- <xsl:apply-templates select="*"/>
+ <xsl:choose>
+ <xsl:when test="$type = 'standalone'">
+ <xsl:apply-templates select="*"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <to_be_embedded>
+ <xsl:apply-templates select="*"/>
+ </to_be_embedded>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- DEFINITION -->
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:helm="http://www.cs.unibo.it/helm">
-<xsl:param name="type" select="0"/>
+<xsl:param name="type" select="'standalone'"/>
<xsl:param name="getterURL" select="'http://localhost:8081/'"/>
<xsl:variable name="absPath"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:variable>
<xsl:template match="Definition">
<xsl:choose>
- <xsl:when test="$type=0">
- <Definition name="{@name}" helm:xref="{@id}">
- <xsl:if test="string(@params) != """>
- <Params>
- <xsl:value-of select="@params"/>
- </Params>
- </xsl:if>
- <body>
+ <xsl:when test="$type='typeonly'">
+ <type>
+ <xsl:apply-templates select="type/*[1]"/>
+ </type>
+ </xsl:when>
+ <xsl:otherwise>
+ <Definition name="{@name}" helm:xref="{@id}">
+ <xsl:if test="string(@params) != """>
+ <Params>
+ <xsl:value-of select="@params"/>
+ </Params>
+ </xsl:if>
+ <body>
<xsl:apply-templates select="body/*[1]"/>
- </body>
+ </body>
<type>
<xsl:apply-templates select="type/*[1]"/>
</type>
</Definition>
- </xsl:when>
- <xsl:otherwise>
- <type>
- <xsl:apply-templates select="type/*[1]"/>
- </type>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:variable name="uri" select="concat(string($current_uri),$delim,string(@uri))"/>
<xsl:copy>
<xsl:copy-of select="@as"/>
- <xsl:attribute name="name"><xsl:value-of select="substring-before(@uri,".")"/></xsl:attribute>
+ <!-- CSC: 'name' is now equal to 'uri' but for the final extension -->
+ <xsl:attribute name="name"><xsl:value-of select="substring-before($uri,".")"/></xsl:attribute>
<xsl:attribute name="uri"><xsl:value-of select="$uri"/></xsl:attribute>
</xsl:copy>
</xsl:template>
</xsl:copy>
</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
doctype-system="DTD/xhtml1-transitional.dtd" />
<xsl:template match="ht:SECTION">
- <h3>BEGIN SECTION<xsl:text> </xsl:text><xsl:value-of select="@name"/></h3>
<xsl:apply-templates select="*"/>
- <h3>END SECTION</h3>
</xsl:template>
<xsl:template match="ht:MUTUAL">
</xsl:template>
<xsl:template match="ht:THEOREM">
- <h5><xsl:value-of select="@as"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@name"/></a></h5>
- <ENTITY uri="{@uri}" type="1"/>
+ <table>
+ <tr>
+ <td colspan="2">
+ <b><xsl:value-of select="@as"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@name"/></a>:</b>
+ </td>
+ </tr>
+ <tr>
+ <td>   </td>
+ <td><ENTITY uri="{@uri}" type="typeonly"/></td>
+ </tr>
+ </table>
</xsl:template>
<xsl:template match="ht:AXIOM|ht:VARIABLE">
- <h5><xsl:value-of select="substring-after(string(name(.)), "ht:")"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@name"/></a></h5>
- <ENTITY uri="{@uri}" type="0"/>
+ <table>
+ <tr>
+ <td colspan="2">
+ <b><xsl:value-of select="substring-after(string(name(.)), "ht:")"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@name"/></a>:</b>
+ </td>
+ </tr>
+ <tr>
+ <td>   </td>
+ <td><ENTITY uri="{@uri}" type="embed"/></td>
+ </tr>
+ </table>
</xsl:template>
<xsl:template match="ht:DEFINITION">
<xsl:variable name="name"><xsl:choose><xsl:when test="@as='Inductive'">Inductive Definition</xsl:when><xsl:when test="@as='CoInductive'">CoInductive Definition</xsl:when><xsl:when test="@as='Record'">Record Definition</xsl:when><xsl:otherwise>Definition</xsl:otherwise></xsl:choose></xsl:variable>
- <h5><xsl:value-of select="string($name)"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@name"/></a></h5>
- <ENTITY uri="{@uri}" type="0"/>
+ <table>
+ <tr>
+ <td colspan="2">
+ <b><xsl:value-of select="string($name)"/><xsl:text> </xsl:text><a href="{@uri}"><xsl:value-of select="@name"/></a>:</b>
+ </td>
+ </tr>
+ <tr>
+ <td>   </td>
+ <td><ENTITY uri="{@uri}" type="embed"/></td>
+ </tr>
+ </table>
</xsl:template>
<!-- Root and XHTML -->
</xsl:template>
</xsl:stylesheet>
-
-
-
-
-
-
-