diff artifacts/doc/conf/meta-data.xml @ 8773:cc1f59766e49

(issue1839) Consider more than one location in ld_locations.
author Tom Gottfried <tom@intevation.de>
date Fri, 28 Aug 2015 16:24:01 +0200
parents af840bf7f05a
children 7bbfb24e6eec
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Fri Aug 28 12:56:53 2015 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Fri Aug 28 16:24:01 2015 +0200
@@ -3197,13 +3197,33 @@
     </dc:macro>
 
     <dc:macro name="artifact-range">
-      <dc:variable name="fromkm" type="number" expr="dc:fromValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_from'))"/>
-      <dc:variable name="tokm" type="number" expr="dc:toValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_to'))"/>
-      <dc:if test="$fromkm > $tokm">
-        <dc:message>Inverting KM filter.</dc:message>
-        <dc:variable name="fromkm" type="number" expr="dc:toValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_to'))"/>
-        <dc:variable name="tokm" type="number" expr="dc:fromValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_from'))"/>
-      </dc:if>
+      <dc:choose>
+        <dc:when test="dc:coalesce(dc:get('ld_locations'), ' ') != ' '">
+          <dc:variable name="fromkm" type="number"
+                       expr="dc:min-number(dc:find-all('\d*\.?\d*',
+                             dc:get('ld_locations')))"/>
+          <dc:variable name="tokm" type="number"
+                       expr="dc:max-number(dc:find-all('\d*\.?\d*',
+                             dc:get('ld_locations')))"/>
+        </dc:when>
+        <dc:otherwise>
+          <dc:variable name="fromkm" type="number"
+                       expr="dc:fromValue(dc:get('ld_mode'),
+                             dc:get('ld_locations'), dc:get('ld_from'))"/>
+          <dc:variable name="tokm" type="number"
+                       expr="dc:toValue(dc:get('ld_mode'),
+                             dc:get('ld_locations'), dc:get('ld_to'))"/>
+          <dc:if test="$fromkm > $tokm">
+            <dc:message>Inverting KM filter.</dc:message>
+            <dc:variable name="fromkm" type="number"
+                         expr="dc:toValue(dc:get('ld_mode'),
+                               dc:get('ld_locations'), dc:get('ld_to'))"/>
+            <dc:variable name="tokm" type="number"
+                         expr="dc:fromValue(dc:get('ld_mode'),
+                               dc:get('ld_locations'), dc:get('ld_from'))"/>
+          </dc:if>
+        </dc:otherwise>
+      </dc:choose>
       <dc:macro-body/>
     </dc:macro>
 

http://dive4elements.wald.intevation.org