Recognize meta fields in map

master v1.1.0
Mike Gerwitz 2017-07-07 16:44:36 -04:00
commit b5f40cb1ce
1 changed files with 11 additions and 21 deletions

View File

@ -929,31 +929,21 @@
<template match="lvm:program-map" mode="lvmc:validate-ui">
<param name="ui" />
<variable name="knowns" as="xs:string*"
select="$ui//lvp:question/@id,
$ui//lvp:external/@id,
$ui//lvp:calc/@id,
for $id in $ui//lvp:meta/lvp:field/@id
return concat( 'meta:', $id )" />
<!-- get a list of unknown source mappings -->
<!-- TODO: this is a mess -->
<variable name="unknown-pre" select="
.//lvm:pass[
not( @name=($ui//lvp:question/@id|$ui//lvp:external/@id) )
and not( @name=$ui//lvp:calc/@id )
]
|
.//lvm:map[
@from
and not( @from=($ui//lvp:question/@id|$ui//lvp:external/@id) )
and not( @from=$ui//lvp:calc/@id )
]
|
.//lvm:from[
not( @name=($ui//lvp:question/@id|$ui//lvp:external/@id) )
and not( @name=$ui//lvp:calc/@id )
]
|
.//lvm:set[
@each
and not( @each=($ui//lvp:question/@id|$ui//lvp:external/@id) )
and not( @each=$ui//lvp:calc/@id )
]
.//lvm:pass[ not( @name = $knowns ) ],
.//lvm:map[ @from and not( @from = $knowns ) ],
.//lvm:from[ not( @name = $knowns ) ],
.//lvm:set[ @each and not( @each = $knowns ) ]
" />
<variable name="unknown"