Provide friendly lv:param-typedef-lookup failure for duplicate item values

The real solution is to disallow typedefs from getting into this state to
begin with, but I don't have time for that right now.
master
Mike Gerwitz 2019-10-25 13:56:47 -04:00
parent e97f7a75c9
commit 3ef6571922
1 changed files with 8 additions and 0 deletions

View File

@ -1386,6 +1386,14 @@
select="$typedef//lv:item[ @value = $query-value ]/@name" />
<choose>
<when test="count( $const-name ) gt 1">
<message terminate="yes"
select="concat( 'error: the value ''', $query-value, ''' ',
'is associated with more than one item in ''',
$tname, ''': ',
string-join( $const-name, ', ' ) )" />
</when>
<when test="not( $const-name )">
<!-- error out only if lookup failures aren't explicitly suppressed -->
<if test="not( @ignore-missing = 'true' )">