preproc: Copy rate-each/@dim only if it exists

If it is copied an yields an empty value, then it is later converted into a
0, which is wholly incorrect in the case of generators.

* src/current/include/preproc/macros.xsl (preproc:macros)[lv:rate-each]:
  Conditionally copy `@dim'.
master
Mike Gerwitz 2017-12-19 14:21:08 -05:00
parent 872da96f9e
commit 62c4ce402c
1 changed files with 5 additions and 1 deletions

View File

@ -403,7 +403,11 @@
<xsl:sequence select="./lv:class" />
<c:sum of="_CMATCH_" index="{@index}" sym="{@gensym}" dim="{@dim}">
<c:sum of="_CMATCH_" index="{@index}" sym="{@gensym}">
<xsl:if test="@dim">
<xsl:copy-of select="@dim" />
</xsl:if>
<!-- copy @generates, if it exists (has the benefit of copying nothing
if it does not exist) -->
<xsl:sequence select="@generates" />