summary: Correct rendering of externs in matches

This same problem can occur anywhere---everything needs to be converted to
use the new `preproc:sym-lookup', but I don't have the time at the moment.

* src/current/summary.xsl (preproc:sym-lookup): New function.
  (program): New toplevel variable.
  (process-match)[lv:match]: Use function.
master
Mike Gerwitz 2017-12-15 09:34:11 -05:00
parent dd42267bc9
commit 337153aaa7
1 changed files with 17 additions and 4 deletions

View File

@ -26,6 +26,7 @@
<xsl:stylesheet version="2.0" <xsl:stylesheet version="2.0"
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:lv="http://www.lovullo.com/rater" xmlns:lv="http://www.lovullo.com/rater"
xmlns:lvp="http://www.lovullo.com" xmlns:lvp="http://www.lovullo.com"
xmlns:c="http://www.lovullo.com/calc" xmlns:c="http://www.lovullo.com/calc"
@ -61,6 +62,7 @@
and JS --> and JS -->
<xsl:param name="fw-path" select="lv:package/@__rootpath" /> <xsl:param name="fw-path" select="lv:package/@__rootpath" />
<xsl:variable name="program" select="/lv:package" />
<!-- <!--
@ -1192,9 +1194,7 @@
--> -->
<xsl:template match="lv:match" priority="5" mode="process-match"> <xsl:template match="lv:match" priority="5" mode="process-match">
<xsl:variable name="on" select="@on" /> <xsl:variable name="on" select="@on" />
<xsl:variable name="sym" select=" <xsl:variable name="sym" select="preproc:sym-lookup( $on )" />
/lv:*/preproc:symtable/preproc:sym[ @name=$on ]
" />
<p class="debugid"> <p class="debugid">
<xsl:attribute name="id"> <xsl:attribute name="id">
@ -1211,7 +1211,7 @@
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="@on" /> <xsl:value-of select="$sym/@name" />
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
@ -2223,4 +2223,17 @@
</xsl:template> </xsl:template>
<!--
TODO: Everything should use this rather than consulting the symbol table
directly! Further, anything that does not return a symbol is likely not
linked, in which case it should not be rendered at all. Maybe we should
output those somewhere.
-->
<xsl:function name="preproc:sym-lookup" as="element( preproc:sym )">
<xsl:param name="name" as="xs:string" />
<xsl:sequence select="$program/l:dep/preproc:sym[ @name=$name ]" />
</xsl:function>
</xsl:stylesheet> </xsl:stylesheet>