validate: Error on nested rate blocks (bugfix)

* src/current/compiler/validate.xsl (lvv:validate)
    [lv:rate[ancestor::lv:rate]]: Error on nested rate block.
master
Mike Gerwitz 2018-01-31 10:27:29 -05:00
parent 9c4fbdace9
commit c0370690f4
1 changed files with 18 additions and 0 deletions

View File

@ -681,6 +681,24 @@
</xsl:template>
<!--
Rate block cannot be nested.
-->
<xsl:template mode="lvv:validate" priority="8"
match="lv:rate[ ancestor::lv:rate ]">
<xsl:variable name="within" as="element( lv:rate )"
select="ancestor::lv:rate[1]" />
<xsl:call-template name="lvv:error">
<xsl:with-param name="desc" select="'Nested rate block'" />
<xsl:with-param name="refnode" select="." />
<xsl:with-param name="content"
select="concat( '`', @yields, ''' cannot be nested ',
'within `', $within/@yields, '''' )" />
</xsl:call-template>
</xsl:template>
<!--
Throws an error if a generator is requested using unsupported data