Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 e4dc74d..1a48376 100644
--- a/src/current/compiler/validate.xsl
+++ b/src/current/compiler/validate.xsl
@@ -682,6 +682,24 @@
<!--
+ 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
Specifically, a generator is intended to generate a set from an expression