Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-07-07 16:44:36 -0400
committerMike Gerwitz <gerwitzm@lovullo.com>2017-07-07 16:44:36 -0400
commitb5f40cb1ce5e7d97b07e592ab608a5b7beae4e2d (patch)
tree87dece43bbc3e3a8e02f9e91c07f68e7ef1c6af5
parent652465a0a0e5be93b2c5df56b3e92e6166b936bd (diff)
parente237ab47f2128f68f03c1a070d4c9d52048b8223 (diff)
downloadtame-b5f40cb1ce5e7d97b07e592ab608a5b7beae4e2d.tar.gz
tame-b5f40cb1ce5e7d97b07e592ab608a5b7beae4e2d.tar.bz2
tame-b5f40cb1ce5e7d97b07e592ab608a5b7beae4e2d.zip
Recognize meta fields in mapv1.1.0
-rw-r--r--src/current/compiler/map.xsl32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/current/compiler/map.xsl b/src/current/compiler/map.xsl
index 65e3190..6b43ecf 100644
--- a/src/current/compiler/map.xsl
+++ b/src/current/compiler/map.xsl
@@ -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"