Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-01 11:52:31 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-01 13:08:03 -0500
commitcac38d5e063bae251a7f6283653c2f937a5f8c47 (patch)
tree3b8225e3084bf44d4c687676970f72794e37b52c
parentc5fcc3ccd2ac9e99740cc3f338d8db4643a491fc (diff)
downloadtame-cac38d5e063bae251a7f6283653c2f937a5f8c47.tar.gz
tame-cac38d5e063bae251a7f6283653c2f937a5f8c47.tar.bz2
tame-cac38d5e063bae251a7f6283653c2f937a5f8c47.zip
lv:rate/@generates: Validation error (bugfix)
* src/current/compiler/validate.xsl (lvv:validate)[lv:rate[@generates]]: Throw validation error.
-rw-r--r--src/current/compiler/validate.xsl18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/current/compiler/validate.xsl b/src/current/compiler/validate.xsl
index 1a48376..d7b00d7 100644
--- a/src/current/compiler/validate.xsl
+++ b/src/current/compiler/validate.xsl
@@ -682,6 +682,24 @@
<!--
+ 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.
-->
<xsl:template mode="lvv:validate" priority="8"