lv:rate/@generates: Validation error (bugfix)

* src/current/compiler/validate.xsl (lvv:validate)[lv:rate[@generates]]:
  Throw validation error.
master
Mike Gerwitz 2018-02-01 11:52:31 -05:00
parent c5fcc3ccd2
commit cac38d5e06
1 changed files with 18 additions and 0 deletions

View File

@ -681,6 +681,24 @@
</xsl:template>
<!--
lv:rate blocks have no use for @generates. Since XSDs don't work within
templates, let's validate that independently. This is particularly
important for developers unfamiliar with the distinction between lv:rate
and lv:rate-each.
-->
<xsl:template mode="lvv:validate" priority="7"
match="lv:rate[ @generates ]">
<xsl:call-template name="lvv:error">
<xsl:with-param name="desc" select="'lv:rate/@generate'" />
<xsl:with-param name="refnode" select="." />
<xsl:with-param name="content"
select="concat( '`', @yields, ''': lv:rate does ',
'not support @generates' )" />
</xsl:call-template>
</xsl:template>
<!--
Rate block cannot be nested.
-->