map: Support `from' within `set'

This was just a matter of proxying `type'.

* src/current/compiler/map.xsl (lvmc:compile): Proxy `type' param.
master
Mike Gerwitz 2018-04-11 14:30:08 -04:00
parent 6a45b2c95a
commit ba1faa74da
1 changed files with 10 additions and 2 deletions

View File

@ -618,12 +618,16 @@
</template>
<template match="lvm:map//lvm:set[@ignore-empty='true']" mode="lvmc:compile" priority="3">
<param name="type" as="xs:string"/>
<text>(function(){</text>
<text>var ret=[]; var tmp;</text>
<for-each select="./lvm:*">
<text>tmp=</text>
<apply-templates select="." mode="lvmc:compile" />
<apply-templates select="." mode="lvmc:compile">
<with-param name="type" select="$type" />
</apply-templates>
<text>;</text>
<text>if(tmp&amp;&amp;tmp!=='0')ret.push(tmp);</text>
@ -634,13 +638,17 @@
</template>
<template match="lvm:map//lvm:set" mode="lvmc:compile" priority="2">
<param name="type" as="xs:string"/>
<text>[</text>
<for-each select="./lvm:*">
<if test="position() > 1">
<text>,</text>
</if>
<apply-templates select="." mode="lvmc:compile" />
<apply-templates select="." mode="lvmc:compile">
<with-param name="type" select="$type" />
</apply-templates>
</for-each>
<text>]</text>
</template>