summary: Correct rendering of classifications using equations

* src/current/include/calc-display.xsl (calc-iversons)[recurse]: Add
    parameter.  Conditionally recurse.
* src/current/summary.xsl (match-desc): Properly process c:* children.
master
Mike Gerwitz 2017-12-14 11:16:16 -05:00
parent 2ccf78544a
commit dc5e5b74dc
2 changed files with 41 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<!--
Handles calculation output in LaTeX format for styling by Mathjax
Copyright (C) 2016 LoVullo Associates, Inc.
Copyright (C) 2016, 2017 LoVullo Associates, Inc.
This file is part of TAME.
@ -631,6 +631,8 @@
@return LaTeX equation
-->
<xsl:template match="c:eq|c:ne|c:gt|c:lt|c:gte|c:lte" mode="calc-iversons">
<xsl:param name="recurse" select="true()" />
<xsl:variable name="name" select="local-name()" />
<!-- map to LaTeX equivalent -->
@ -646,7 +648,9 @@
<xsl:value-of select="$map/*[ @id=$name ]" />
<xsl:text> </xsl:text>
<xsl:apply-templates select="." mode="calc-recurse" />
<xsl:if test="$recurse">
<xsl:apply-templates select="." mode="calc-recurse" />
</xsl:if>
</xsl:template>

View File

@ -1348,11 +1348,45 @@
<xsl:text> be </xsl:text>
<xsl:text>\(</xsl:text>
<xsl:apply-templates select="./c:*" mode="calc-iversons" />
<xsl:apply-templates select="./c:*" mode="calc-iversons">
<xsl:with-param name="recurse" select="false()" />
</xsl:apply-templates>
<xsl:text>\) </xsl:text>
<xsl:apply-templates mode="match-desc"
select="c:*/c:*" />
</xsl:template>
<xsl:template match="c:value-of" mode="match-desc" priority="5">
<xsl:variable name="name"
select="@name" />
<xsl:variable name="sym" as="element( preproc:sym )"
select="/lv:*/preproc:symtable/preproc:sym[ @name=$name ]" />
<a href="#{$name}" class="sym-ref sym-{$sym/@type}">
<xsl:value-of select="$name" />
</a>
</xsl:template>
<xsl:template match="c:const" mode="match-desc" priority="5">
<xsl:text>\(</xsl:text>
<xsl:value-of select="@value" />
<xsl:text>\)</xsl:text>
</xsl:template>
<xsl:template match="c:*" mode="match-desc" priority="1">
<xsl:message terminate="yes">
<xsl:text>[summary] internal: unknown match calculation for `</xsl:text>
<xsl:value-of select="ancestor::c:classify/@as" />
<xsl:text>'</xsl:text>
</xsl:message>
</xsl:template>
<!--
Output function details