diff flys-artifacts/doc/conf/meta-data.xml @ 5522:eeac800eb4cd

Datacage: Rename <dc:elements> to <dc:for-each>. We should have done this much earlier.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 29 Mar 2013 11:07:24 +0100
parents 56d18ecc7d41
children 35dba807966a
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/meta-data.xml	Thu Mar 28 18:49:48 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Fri Mar 29 11:07:24 2013 +0100
@@ -38,11 +38,11 @@
           FROM master_artifacts_range
           WHERE gid = CAST(${artifact-id} as uuid)
         </dc:statement>
-        <dc:elements>
+        <dc:for-each>
           <dc:variable name="fromkm" type="number" expr="dc:fromValue($ldm, $ldl, $ldf)"/>
           <dc:variable name="tokm" type="number" expr="dc:toValue($ldm, $ldl, $ldt)"/>
           <dc:macro-body/>
-        </dc:elements>
+        </dc:for-each>
         </dc:context>
       </dc:when>
       <dc:otherwise>
@@ -62,7 +62,7 @@
         SELECT id AS river_id, name as river_name FROM rivers
         WHERE lower(name) LIKE lower(${river})
       </dc:statement>
-      <dc:elements>
+      <dc:for-each>
 
         <dc:comment>
           Base-data macros (mostly data imported from wst-files).
@@ -77,22 +77,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 0 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <basedata>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="base_data-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </basedata>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </basedata>
           </dc:call-macro>
@@ -108,22 +108,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 0 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <basedata>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="base_data-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="wqinterpol"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </basedata>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </basedata>
           </dc:call-macro>
@@ -139,22 +139,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 1 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <additional>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="additionalsmarks-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </additional>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </additionals>
           </dc:call-macro>
@@ -170,22 +170,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 1 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <additional>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </additional>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </additionals>
           </dc:call-macro>
@@ -201,22 +201,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 1 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <relativepoint>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </relativepoint>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </additionals>
           </dc:call-macro>
@@ -231,23 +231,23 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 2 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <fixation>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <!--dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/-->
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="wqinterpol"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </fixation>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </fixations>
           </dc:call-macro>
@@ -262,22 +262,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 2 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <fixation>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="wqinterpol"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </fixation>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </fixations>
           </dc:call-macro>
@@ -292,22 +292,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 2 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <fixation>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </fixation>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </fixations>
           </dc:call-macro>
@@ -322,22 +322,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 2 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <relativepoint>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </relativepoint>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </fixations>
           </dc:call-macro>
@@ -353,22 +353,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 3 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <official>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwqkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </official>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </officiallines>
           </dc:call-macro>
@@ -383,22 +383,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 4 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <relativepoint>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </relativepoint>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </heightmarks>
           </dc:call-macro>
@@ -413,22 +413,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 4 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <heightmark>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </heightmark>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </heightmarks>
           </dc:call-macro>
@@ -443,22 +443,22 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 4 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <heightmark>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="heightmarks_annotations-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="wqinterpol"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </heightmark>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </heightmarks>
           </dc:call-macro>
@@ -474,7 +474,7 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 5 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <relativepoint>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:attribute name="db-id" value="${prot_id}"/>
@@ -482,18 +482,18 @@
                     <columns>
                       <dc:context>
                         <dc:call-macro name="SQL-wst_columns_statement"/>
-                        <dc:elements>
+                        <dc:for-each>
                           <column>
                             <dc:attribute name="name" value="${prot_column_name}"/>
                             <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/>
                             <dc:attribute name="factory" value="staticwkms"/>
                             <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                           </column>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </columns>
                   </relativepoint>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </flood_protections>
           </dc:call-macro>
@@ -509,24 +509,24 @@
                          description AS prot_description
                   FROM wsts WHERE kind = 5 AND river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <flood_protection>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:attribute name="db-id" value="${prot_id}"/>
                     <dc:attribute name="factory" value="staticwkms"/>
                     <dc:context>
                       <dc:call-macro name="SQL-wst_columns_statement"/>
-                      <dc:elements>
+                      <dc:for-each>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
                           <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/>
                           <dc:attribute name="factory" value="staticwkms"/>
                           <dc:attribute name="info" value="${info} [km ${deffrom} - ${defto}]"/>
                         </column>
-                      </dc:elements>
+                      </dc:for-each>
                     </dc:context>
                   </flood_protection>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </flood_protections>
           </dc:call-macro>
@@ -574,13 +574,13 @@
                        name AS anno_description
                 FROM annotation_types
               </dc:statement>
-              <dc:elements>
+              <dc:for-each>
                 <annotation>
                   <dc:attribute name="name"    value="${anno_description}"/>
                   <dc:attribute name="factory" value="annotations"/>
                   <dc:attribute name="ids"     value="${river_id}:${anno_description}"/>
                 </annotation>
-             </dc:elements>
+             </dc:for-each>
             </dc:context>
           </annotations>
         </dc:macro>
@@ -599,13 +599,13 @@
                   WHERE cs.river_id = ${river_id}
                     AND csl.km BETWEEN ${fromkm} AND ${tokm}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <cross_section>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:attribute name="ids" value="${prot_id}"/>
                     <dc:attribute name="factory" value="crosssections"/>
                   </cross_section>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </cross_sections>
           </dc:call-macro>
@@ -625,13 +625,13 @@
                   WHERE river_id = ${river_id}
                     AND he.km BETWEEN ${fromkm} AND ${tokm}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <hyk>
                     <dc:attribute name="name" value="${hyk_description}"/>
                     <dc:attribute name="ids" value="${hyk_id}"/>
                     <dc:attribute name="factory" value="hyk"/>
                   </hyk>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </hyks>
           </dc:call-macro>
@@ -646,7 +646,7 @@
                          description AS fvmd
                   FROM flow_velocity_measurements WHERE river_id = ${river_id}
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <flow_velocity_measurement>
                     <dc:attribute name="name" value="${fvmd}"/>
                     <dc:attribute name="ids" value="${fvmid}"/>
@@ -658,16 +658,16 @@
                                 WHERE measurements_id = ${fvmid}
                                   AND station BETWEEN ${fromkm} AND ${tokm}
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                            <measurement_value>
                              <dc:attribute name="name" value="${id}-${description}-${station}-${datetime}"/>
                              <dc:attribute name="ids" value="${id}"/>
                              <dc:attribute name="factory" value="flowvelocity"/>
                            </measurement_value>
-                         </dc:elements>
+                         </dc:for-each>
                     </dc:context>
                   </flow_velocity_measurement>
-              </dc:elements>
+              </dc:for-each>
           </dc:context>
           </flowvelocitymeasurement>
         </dc:call-macro>
@@ -682,13 +682,13 @@
                          description AS bedh_descr
                   FROM bed_height_single WHERE river_id = ${river_id}
               </dc:statement>
-              <dc:elements>
+              <dc:for-each>
                 <height>
                   <dc:attribute name="factory" value="bedheight"/>
                   <dc:attribute name="ids" value="bedheight-singlevalues-${bedh_id}-${bedh_year}"/>
                   <dc:attribute name="description" value="${bedh_descr}"/>
                 </height>
-              </dc:elements>
+              </dc:for-each>
             </dc:context>
           </soundings_width>
         </dc:macro>
@@ -856,7 +856,7 @@
                            name AS gauge_name
                     FROM gauges WHERE river_id = ${river_id}
                   </dc:statement>
-                  <dc:elements>
+                  <dc:for-each>
                     <gauge>
                       <dc:attribute name="name" value="${gauge_name}"/>
                       <dc:attribute name="db-id" value="${gauge_id}"/>
@@ -879,7 +879,7 @@
                           ON d.time_interval_id = ti.id
                           WHERE d.gauge_id = ${gauge_id} AND d.kind = 1
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <historical>
                             <dc:attribute name="name" value="${gauge_desc}"/>
                             <dc:attribute name="factory" value="gaugedischarge"/>
@@ -887,11 +887,11 @@
                             <dc:attribute name="to" value="${g_stop}"/>
                             <dc:attribute name="ids" value="${discharge_id}-${g_start}-${g_stop}"/>
                           </historical>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </gauge>
                     -->
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:context>
               </discharge_table_gauge>
 
@@ -922,7 +922,7 @@
                            name AS gauge_name
                     FROM gauges WHERE river_id = ${river_id}
                   </dc:statement>
-                  <dc:elements>
+                  <dc:for-each>
                     <gauge>
                       <dc:attribute name="name" value="${gauge_name}"/>
                       <dc:attribute name="db-id" value="${gauge_id}"/>
@@ -931,7 +931,7 @@
                       <dc:attribute name="to" value="${g_stop}"/>
                       <dc:attribute name="ids" value="${gauge_name}"/>
                     </gauge>
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:context>
               </discharge_table_gauge>
             </discharge_table_nn>
@@ -989,14 +989,14 @@
                            JOIN time_intervals t ON d.time_interval_id = t.id
                            WHERE d.river_id = ${river_id}
                   </dc:statement>
-                  <dc:elements>
+                  <dc:for-each>
                       <dem>
                         <dc:attribute name="factory" value="demfactory"/>
                         <dc:attribute name="ids" value="${dem_id}"/>
                         <dc:attribute name="name" value="${name}"/>
                         <dc:attribute name="info" value="${info}"/>
                       </dem>
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:context>
               </dems>
             </dc:macro>
@@ -1013,54 +1013,54 @@
                 <lines>
                   <official>
                     <Durchlass>
-                      <dc:elements filter="$hws_kind=1 and $hws_official=1">
+                      <dc:for-each filter="$hws_kind=1 and $hws_official=1">
                           <hws>
                             <dc:attribute name="factory" value="hwsfactory"/>
                             <dc:attribute name="name" value="${hws_name}"/>
                           </hws>
-                      </dc:elements>
+                      </dc:for-each>
                     </Durchlass>
                     <Damm>
-                      <dc:elements filter="$hws_kind=2 and $hws_official=1">
+                      <dc:for-each filter="$hws_kind=2 and $hws_official=1">
                           <hws>
                             <dc:attribute name="factory" value="hwsfactory"/>
                             <dc:attribute name="name" value="${hws_name}"/>
                           </hws>
-                      </dc:elements>
+                      </dc:for-each>
                     </Damm>
                     <Graben>
-                      <dc:elements filter="$hws_kind=3 and $hws_official=1">
+                      <dc:for-each filter="$hws_kind=3 and $hws_official=1">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_name}"/>
                         </hws>
-                      </dc:elements>
+                      </dc:for-each>
                     </Graben>
                   </official>
                   <inofficial>
                     <Durchlass>
-                      <dc:elements filter="$hws_kind=1 and $hws_official=0">
+                      <dc:for-each filter="$hws_kind=1 and $hws_official=0">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_name}"/>
                         </hws>
-                      </dc:elements>
+                      </dc:for-each>
                     </Durchlass>
                     <Damm>
-                      <dc:elements filter="$hws_kind=2 and $hws_official=0">
+                      <dc:for-each filter="$hws_kind=2 and $hws_official=0">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_name}"/>
                         </hws>
-                      </dc:elements>
+                      </dc:for-each>
                     </Damm>
                     <Graben>
-                      <dc:elements filter="$hws_kind=3 and $hws_official=0">
+                      <dc:for-each filter="$hws_kind=3 and $hws_official=0">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_name}"/>
                         </hws>
-                      </dc:elements>
+                      </dc:for-each>
                     </Graben>
                   </inofficial>
                 </lines>
@@ -1079,54 +1079,54 @@
                 <points>
                   <official>
                     <Durchlass>
-                      <dc:elements filter="$hws_points_kind=1 and $hws_points_official=1">
-                        <hws>
-                          <dc:attribute name="factory" value="hwsfactory"/>
-                          <dc:attribute name="name" value="${hws_points_name}"/>
-                        </hws>
-                      </dc:elements>
-                    </Durchlass>
-                    <Damm>
-                      <dc:elements filter="$hws_points_kind=2 and $hws_points_official=1">
-                        <hws>
-                          <dc:attribute name="factory" value="hwsfactory"/>
-                          <dc:attribute name="name" value="${hws_points_name}"/>
-                        </hws>
-                      </dc:elements>
-                    </Damm>
-                    <Graben>
-                      <dc:elements filter="$hws_kind=3 and $hws_official=1">
+                      <dc:for-each filter="$hws_points_kind=1 and $hws_points_official=1">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_points_name}"/>
                         </hws>
-                      </dc:elements>
-                    </Graben>
-                  </official>
-                  <inofficial>
-                    <Durchlass>
-                      <dc:elements filter="$hws_points_kind=1 and $hws_points_official=0">
+                      </dc:for-each>
+                    </Durchlass>
+                    <Damm>
+                      <dc:for-each filter="$hws_points_kind=2 and $hws_points_official=1">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_points_name}"/>
                         </hws>
-                      </dc:elements>
-                    </Durchlass>
-                    <Damm>
-                      <dc:elements filter="$hws_points_kind=2 and $hws_points_official=0">
+                      </dc:for-each>
+                    </Damm>
+                    <Graben>
+                      <dc:for-each filter="$hws_kind=3 and $hws_official=1">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_points_name}"/>
                         </hws>
-                      </dc:elements>
-                    </Damm>
-                    <Graben>
-                      <dc:elements filter="$hws_points_kind=3 and $hws_points_official=0">
+                      </dc:for-each>
+                    </Graben>
+                  </official>
+                  <inofficial>
+                    <Durchlass>
+                      <dc:for-each filter="$hws_points_kind=1 and $hws_points_official=0">
                         <hws>
                           <dc:attribute name="factory" value="hwsfactory"/>
                           <dc:attribute name="name" value="${hws_points_name}"/>
                         </hws>
-                      </dc:elements>
+                      </dc:for-each>
+                    </Durchlass>
+                    <Damm>
+                      <dc:for-each filter="$hws_points_kind=2 and $hws_points_official=0">
+                        <hws>
+                          <dc:attribute name="factory" value="hwsfactory"/>
+                          <dc:attribute name="name" value="${hws_points_name}"/>
+                        </hws>
+                      </dc:for-each>
+                    </Damm>
+                    <Graben>
+                      <dc:for-each filter="$hws_points_kind=3 and $hws_points_official=0">
+                        <hws>
+                          <dc:attribute name="factory" value="hwsfactory"/>
+                          <dc:attribute name="name" value="${hws_points_name}"/>
+                        </hws>
+                      </dc:for-each>
                     </Graben>
                   </inofficial>
                 </points>
@@ -1138,14 +1138,14 @@
                   SELECT count(*) as km_exists
                   FROM river_axes_km WHERE river_id = ${river_id}
                 </dc:statement>
-                 <dc:elements>
+                 <dc:for-each>
                   <dc:if test="$km_exists>0">
                     <kilometrage>
                       <dc:attribute name="factory" value="wmskmfactory"/>
                       <dc:attribute name="ids" value="${river_id}"/>
                     </kilometrage>
                   </dc:if>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </dc:macro>
             <dc:macro name="flood-map-qps">
@@ -1161,13 +1161,13 @@
                   AND kind_id=1
                 </dc:statement>
                 <dc:if test="dc:has-result()">
-                  <dc:elements>
+                  <dc:for-each>
                     <actual>
                       <dc:attribute name="description" value="${kind_name}"/>
                       <dc:attribute name="factory" value="wmsqpsfactory"/>
                       <dc:attribute name="ids" value="${river_id};${kind_name};${kind_id}"/>
                     </actual>
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:if>
               </dc:context>
               <dc:context>
@@ -1184,13 +1184,13 @@
                 </dc:statement>
                 <dc:if test="dc:has-result()">
                   <other>
-                    <dc:elements>
+                    <dc:for-each>
                       <misc-qps>
                         <dc:attribute name="description" value="${layer_name}"/>
                         <dc:attribute name="factory" value="wmsqpsfactory"/>
                         <dc:attribute name="ids" value="${river_id};${layer_name};${kind_id}"/>
                       </misc-qps>
-                    </dc:elements>
+                    </dc:for-each>
                   </other>
                 </dc:if>
               </dc:context>
@@ -1207,12 +1207,12 @@
                   AND kind_id=1
                 </dc:statement>
                 <dc:if test="dc:has-result()">
-                  <dc:elements>
+                  <dc:for-each>
                     <actual factory="riveraxis">
                       <dc:attribute name="description" value="${kind_name}"/>
                       <dc:attribute name="ids" value="${river_id};${kind_name};${kind_id}"/>
                     </actual>
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:if>
               </dc:context>
               <dc:context>
@@ -1228,12 +1228,12 @@
                 </dc:statement>
                 <dc:if test="dc:has-result()">
                   <other>
-                    <dc:elements>
+                    <dc:for-each>
                       <misc-axis factory="riveraxis">
                         <dc:attribute name="description" value="${layer_name}"/>
                         <dc:attribute name="ids" value="${river_id};${layer_name};${kind_id}"/>
                       </misc-axis>
-                    </dc:elements>
+                    </dc:for-each>
                   </other>
                 </dc:if>
               </dc:context>
@@ -1247,11 +1247,11 @@
                   WHERE river_id = ${river_id}
                   AND kind = 2
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <line factory="wmshydrboundariesfactory"
                     ids="{$river_id};{$name};2"
                     name="{$name}"/>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
               <dc:context>
                 <dc:statement>
@@ -1261,11 +1261,11 @@
                   WHERE river_id = ${river_id}
                   AND kind = 2
                 </dc:statement>
-                <dc:elements>
+                <dc:for-each>
                   <line factory="wmshydrboundariespolyfactory"
                     ids="{$river_id};{$name};2"
                     name="{$name}"/>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </dc:macro>
             <dc:macro name="flood-map-hydr-boundaries-lines">
@@ -1280,11 +1280,11 @@
                 <dc:comment> What about all other line kinds?</dc:comment>
                 <dc:if test="dc:has-result()">
                   <lines>
-                    <dc:elements>
+                    <dc:for-each>
                       <line factory="wmshydrboundariesfactory"
                         ids="{$river_id};{$name};1"
                         name="{$name}"/>
-                    </dc:elements>
+                    </dc:for-each>
                   </lines>
                 </dc:if>
               </dc:context>
@@ -1302,11 +1302,11 @@
                 </dc:statement>
                 <dc:if test="dc:has-result()">
                   <sobek_areas>
-                    <dc:elements>
+                    <dc:for-each>
                       <boundary name="{$sectie}"
                         factory="wmshydrboundariespolyfactory"
                         ids="{$river_id};{$sectie};1;{$sectie_id};-1"/>
-                    </dc:elements>
+                    </dc:for-each>
                   </sobek_areas>
                 </dc:if>
               </dc:context>
@@ -1322,11 +1322,11 @@
                 </dc:statement>
                 <dc:if test="dc:has-result()">
                   <sobek_flooded>
-                    <dc:elements>
+                    <dc:for-each>
                       <boundary name="{$sobek}"
                         factory="wmshydrboundariespolyfactory"
                         ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/>
-                    </dc:elements>
+                    </dc:for-each>
                   </sobek_flooded>
                 </dc:if>
               </dc:context>
@@ -1354,11 +1354,11 @@
                   AND kind_id=1
                 </dc:statement>
                 <dc:if test="dc:has-result()">
-                  <dc:elements>
+                  <dc:for-each>
                     <floody factory="wmsfloodplainfactory"
                       description="{$kind_name}"
                       ids="{$river_id};{$kind_name};{$kind_id}"/>
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:if>
               </dc:context>
               <dc:context>
@@ -1374,11 +1374,11 @@
                 </dc:statement>
                 <dc:if test="dc:has-result()">
                   <other>
-                    <dc:elements>
+                    <dc:for-each>
                       <floody factory="wmsfloodplainfactory"
                         description="{$layer_name}"
                         ids="{$river_id};{$layer_name};{$kind_id}"/>
-                    </dc:elements>
+                    </dc:for-each>
                   </other>
                 </dc:if>
               </dc:context>
@@ -1390,31 +1390,31 @@
                 availble
               </dc:comment>
               <Durchlass>
-                <dc:elements filter="$hws_kind=1">
+                <dc:for-each filter="$hws_kind=1">
                   <hws>
                     <dc:attribute name="factory" value="wmshwslinesfactory"/>
                     <dc:attribute name="ids" value="${river_id};${hws_name}"/>
                     <dc:attribute name="name" value="${hws_name}"/>
                   </hws>
-                </dc:elements>
+                </dc:for-each>
               </Durchlass>
               <Damm>
-                <dc:elements filter="$hws_kind=2">
+                <dc:for-each filter="$hws_kind=2">
                   <hws>
                     <dc:attribute name="factory" value="wmshwslinesfactory"/>
                     <dc:attribute name="ids" value="${river_id};${hws_name}"/>
                     <dc:attribute name="name" value="${hws_name}"/>
                   </hws>
-                </dc:elements>
+                </dc:for-each>
               </Damm>
               <Graben>
-                <dc:elements filter="$hws_kind=3">
+                <dc:for-each filter="$hws_kind=3">
                   <hws>
                     <dc:attribute name="factory" value="wmshwslinesfactory"/>
                     <dc:attribute name="ids" value="${river_id};${hws_name}"/>
                     <dc:attribute name="name" value="${hws_name}"/>
                   </hws>
-                </dc:elements>
+                </dc:for-each>
               </Graben>
             </dc:macro>
 
@@ -1431,7 +1431,7 @@
                       WHERE river_id = ${river_id}
                       AND hws.official=1
                     </dc:statement>
-                    <dc:elements>
+                    <dc:for-each>
                       <dc:context>
                         <dc:statement>
                           SELECT DISTINCT
@@ -1447,7 +1447,7 @@
                           <dc:call-macro name="hwslines_by_kind"/>
                         </fedstate>
                       </dc:context>
-                    </dc:elements>
+                    </dc:for-each>
                   </dc:context>
                   <dc:context>
                     <dc:statement>
@@ -1476,7 +1476,7 @@
                       WHERE river_id = ${river_id}
                       AND hws.official=0
                     </dc:statement>
-                    <dc:elements>
+                    <dc:for-each>
                       <dc:context>
                         <dc:statement>
                           SELECT DISTINCT
@@ -1492,7 +1492,7 @@
                           <dc:call-macro name="hwslines_by_kind"/>
                         </fedstate>
                       </dc:context>
-                    </dc:elements>
+                    </dc:for-each>
                   </dc:context>
                   <dc:context>
                     <dc:statement>
@@ -1518,31 +1518,31 @@
                 availble
               </dc:comment>
               <Durchlass>
-                <dc:elements filter="$hws_kind=1">
+                <dc:for-each filter="$hws_kind=1">
                   <hws>
                     <dc:attribute name="factory" value="wmshwspointsfactory"/>
                     <dc:attribute name="ids" value="${river_id};${hws_name}"/>
                     <dc:attribute name="name" value="${hws_name}"/>
                   </hws>
-                </dc:elements>
+                </dc:for-each>
               </Durchlass>
               <Damm>
-                <dc:elements filter="$hws_kind=2">
+                <dc:for-each filter="$hws_kind=2">
                   <hws>
                     <dc:attribute name="factory" value="wmshwspointsfactory"/>
                     <dc:attribute name="ids" value="${river_id};${hws_name}"/>
                     <dc:attribute name="name" value="${hws_name}"/>
                   </hws>
-                </dc:elements>
+                </dc:for-each>
               </Damm>
               <Graben>
-                <dc:elements filter="$hws_kind=3">
+                <dc:for-each filter="$hws_kind=3">
                   <hws>
                     <dc:attribute name="factory" value="wmshwspointsfactory"/>
                     <dc:attribute name="ids" value="${river_id};${hws_name}"/>
                     <dc:attribute name="name" value="${hws_name}"/>
                   </hws>
-                </dc:elements>
+                </dc:for-each>
               </Graben>
             </dc:macro>
 
@@ -1559,7 +1559,7 @@
                       WHERE river_id = ${river_id}
                       AND hws.official=1
                     </dc:statement>
-                    <dc:elements>
+                    <dc:for-each>
                       <dc:context>
                         <dc:statement>
                           SELECT DISTINCT
@@ -1575,7 +1575,7 @@
                           <dc:call-macro name="hwspoints_by_kind"/>
                         </fedstate>
                       </dc:context>
-                    </dc:elements>
+                    </dc:for-each>
                   </dc:context>
                   <dc:context>
                     <dc:statement>
@@ -1604,7 +1604,7 @@
                       WHERE river_id = ${river_id}
                       AND hws.official=0
                     </dc:statement>
-                    <dc:elements>
+                    <dc:for-each>
                       <dc:context>
                         <dc:statement>
                           SELECT DISTINCT
@@ -1620,7 +1620,7 @@
                           <dc:call-macro name="hwspoints_by_kind"/>
                         </fedstate>
                       </dc:context>
-                    </dc:elements>
+                    </dc:for-each>
                   </dc:context>
                   <dc:context>
                     <dc:statement>
@@ -1651,13 +1651,13 @@
                 WHERE b.river_id = ${river_id}
                 AND b.kind_id &lt;&gt; 0
               </dc:statement>
-              <dc:elements>
+              <dc:for-each>
                 <buildings>
                   <dc:attribute name="description" value="${building_kind}"/>
                   <dc:attribute name="factory" value="wmsbuildingsfactory"/>
                   <dc:attribute name="ids" value="${river_id};${building_kind};${building_kind_id}"/>
                 </buildings>
-              </dc:elements>
+              </dc:for-each>
             </dc:context>
             <dc:context>
               <dc:statement>
@@ -1671,17 +1671,17 @@
                 AND kind_id = 0 OR
                 kind_id IS NULL
               </dc:statement>
-              <dc:elements>
+              <dc:for-each>
                 <dc:element name="${building_kind}">
-                  <dc:elements>
+                  <dc:for-each>
                     <buildings>
                       <dc:attribute name="description" value="${building_name}"/>
                       <dc:attribute name="factory" value="wmsbuildingsfactory"/>
                       <dc:attribute name="ids" value="${river_id};${building_name}"/>
                     </buildings>
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:element>
-              </dc:elements>
+              </dc:for-each>
             </dc:context>
             <dc:context>
               <dc:statement>
@@ -1694,13 +1694,13 @@
               </dc:statement>
               <dc:if test="dc:has-result()">
                 <jetties>
-                  <dc:elements>
+                  <dc:for-each>
                     <jetty>
                       <dc:attribute name="description" value="${jetty_kind}"/>
                       <dc:attribute name="factory" value="wmsjettiesfactory"/>
                       <dc:attribute name="ids" value="${river_id};${jetty_kind};${jetty_kind_id}"/>
                     </jetty>
-                  </dc:elements>
+                  </dc:for-each>
                 </jetties>
               </dc:if>
             </dc:context>
@@ -1711,7 +1711,7 @@
                   SELECT count(*) as km_exists, name as name
                   FROM fixpoints WHERE river_id = ${river_id} GROUP BY name
                 </dc:statement>
-                 <dc:elements>
+                 <dc:for-each>
                   <dc:if test="$km_exists>0">
                     <fixpoint>
                       <dc:attribute name="factory" value="wmsfixpointsfactory"/>
@@ -1719,7 +1719,7 @@
                       <dc:attribute name="name"  value="${name}"/>
                     </fixpoint>
                   </dc:if>
-                </dc:elements>
+                </dc:for-each>
               </dc:context>
             </dc:macro>
             <dc:macro name="flood-map-gaugelocations">
@@ -1738,7 +1738,7 @@
                             WHERE river_id = ${river_id} AND kind = 111
                             GROUP BY name, kind
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:if test="$uesg_exist>0">
                             <floodmaps>
                               <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
@@ -1746,7 +1746,7 @@
                               <dc:attribute name="name" value="${name}"/>
                             </floodmaps>
                           </dc:if>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </bfg>
                     <land>
@@ -1757,7 +1757,7 @@
                             WHERE river_id = ${river_id} AND kind = 112
                             GROUP BY name, kind
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:if test="$uesg_exist>0">
                             <floodmaps>
                               <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
@@ -1765,7 +1765,7 @@
                               <dc:attribute name="name" value="${name}"/>
                             </floodmaps>
                           </dc:if>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </land>
                   </current>
@@ -1778,7 +1778,7 @@
                             WHERE river_id = ${river_id} AND kind = 121
                             GROUP BY name, kind
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:if test="$uesg_exist>0">
                             <floodmaps>
                               <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
@@ -1786,7 +1786,7 @@
                               <dc:attribute name="name" value="${name}"/>
                             </floodmaps>
                           </dc:if>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </bfg>
                     <land>
@@ -1797,7 +1797,7 @@
                             WHERE river_id = ${river_id} AND kind = 122
                             GROUP BY name, kind
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:if test="$uesg_exist>0">
                             <floodmaps>
                               <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
@@ -1805,7 +1805,7 @@
                               <dc:attribute name="name" value="${name}"/>
                             </floodmaps>
                           </dc:if>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </land>
                   </potentiel>
@@ -1881,13 +1881,13 @@
                          description AS bedh_descr
                   FROM bed_height_single WHERE river_id = ${river_id}
               </dc:statement>
-              <dc:elements>
+              <dc:for-each>
                 <height>
                   <dc:attribute name="factory" value="bedheight"/>
                   <dc:attribute name="ids" value="bedheight-single-${bedh_id}-${bedh_year}"/>
                   <dc:attribute name="description" value="${bedh_descr}"/>
                 </height>
-              </dc:elements>
+              </dc:for-each>
             </dc:context>
           </single>
         </dc:macro>
@@ -1900,17 +1900,17 @@
                        description      AS bedh_descr
                 FROM bed_height_epoch WHERE river_id = ${river_id}
               </dc:statement>
-              <dc:elements>
+              <dc:for-each>
                 <height>
                   <dc:attribute name="factory" value="bedheight"/>
                   <dc:attribute name="ids" value="bedheight-epoch-${bedh_id}-${bedh_interval_id}"/>
                   <dc:attribute name="description" value="${bedh_descr}"/>
                 </height>
-              </dc:elements>
+              </dc:for-each>
             </dc:context>
           </epoch>
         </dc:macro>
-      </dc:elements>
+      </dc:for-each>
     </dc:context>
   </dc:macro>
 
@@ -1952,20 +1952,20 @@
                    AND EXISTS (
                        SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river})
                  </dc:statement>
-                 <dc:elements>
+                 <dc:for-each>
                    <dc:variable name="from" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"/>
                    <dc:variable name="to" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"/>
                    <dc:if test="($from &gt;= $fromkm and $from &lt;= $tokm) or ($to &lt;= $tokm and $to &gt;= $fromkm) or ($from &lt;= $fromkm and $to &gt;= $tokm)">
                      <dc:macro-body/>
                    </dc:if>
-                 </dc:elements>
+                 </dc:for-each>
                </dc:macro>
  
         <!-- OFFICIAL LINES -->
         <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')">
           <dc:comment comment=".wst -------------------------------"/>
           <officiallines>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:statement>
                     SELECT m.id AS a_id,
@@ -1990,24 +1990,24 @@
                           AND k = 'river'
                           AND v = ${river})
                   </dc:statement>
-                  <dc:elements>
+                  <dc:for-each>
                       <dc:context connection="system">
                         <dc:statement>
                           SELECT ol.wst_id AS wstid, ol.wst_column_pos AS wstcolpos, ol.name AS olname, ol.value AS oval
                           FROM official_q_values ol
                           WHERE ol.value = CAST(${wqsingle} AS NUMERIC(10,2)) AND ol.gauge_name = ${gaugy}
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:element name="${olname}">
                             <dc:attribute name="name" value="${olname}"/>
                             <dc:attribute name="ids" value="additionals-wstv-${wstcolpos}-${wstid}"/>
                             <dc:attribute name="factory" value="staticwkms"/>
                           </dc:element>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
-                  </dc:elements>
+                  </dc:for-each>
                 </dc:context>
-          </dc:elements>
+          </dc:for-each>
           </officiallines>
         </dc:if>
         <!-- END OFFICIAL LINES -->
@@ -2018,7 +2018,7 @@
 
        <dc:macro name="differences">
           <differences>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:call-macro name="range-filter">
                       <dc:context>
@@ -2027,7 +2027,7 @@
                           FROM outs as o, facets as f, artifacts as a
                           WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:element name="${facet_name}">
                             <dc:attribute name="description" value="${facet_description}"/>
                             <dc:attribute name="factory"     value="winfo"/>
@@ -2035,11 +2035,11 @@
                             <dc:attribute name="ids"         value="${aid}"/>
                             <dc:attribute name="out"         value="w_differences"/>
                           </dc:element>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
                 </dc:context>
-            </dc:elements>
+            </dc:for-each>
           </differences>
         </dc:macro>
 
@@ -2050,7 +2050,7 @@
 
         <dc:macro name="reference-curves">
           <reference_curves>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:call-macro name="user-range">
                       <dc:context>
@@ -2059,7 +2059,7 @@
                           FROM outs as o, facets as f, artifacts as a
                           WHERE f.name = 'reference_curve' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:element name="${facet_name}">
                             <dc:attribute name="description" value="${facet_description}"/>
                             <dc:attribute name="factory"     value="winfo"/>
@@ -2067,11 +2067,11 @@
                             <dc:attribute name="ids"         value="${aid}"/>
                             <dc:attribute name="out"         value="reference_curve"/>
                           </dc:element>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
                 </dc:context>
-            </dc:elements>
+            </dc:for-each>
           </reference_curves>
         </dc:macro>
 
@@ -2081,7 +2081,7 @@
 
         <dc:macro name="computed-discharge-curve">
           <computed_discharge_curves>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:call-macro name="range-filter">
                       <dc:context>
@@ -2090,7 +2090,7 @@
                           FROM outs as o, facets as f, artifacts as a
                           WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:element name="${facet_name}">
                             <dc:attribute name="description" value="${facet_description}"/>
                             <dc:attribute name="factory"     value="winfo"/>
@@ -2098,11 +2098,11 @@
                             <dc:attribute name="ids"         value="${aid}"/>
                             <dc:attribute name="out"         value="computed_discharge_curve"/>
                           </dc:element>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
                 </dc:context>
-            </dc:elements>
+            </dc:for-each>
           </computed_discharge_curves>
         </dc:macro>
 
@@ -2113,7 +2113,7 @@
 
         <dc:macro name="waterlevels">
           <waterlevels>
-            <dc:elements>
+            <dc:for-each>
               <dc:context>
                 <dc:call-macro name="range-filter">
                      <dc:context>
@@ -2122,7 +2122,7 @@
                          FROM outs
                          WHERE artifact_id = ${a_id} AND name = 'cross_section'
                        </dc:statement>
-                       <dc:elements>
+                       <dc:for-each>
                          <dc:context>
                            <dc:statement>
                              SELECT name AS facet_name, num as facet_num, description AS facet_description
@@ -2132,7 +2132,7 @@
                            </dc:statement>
                            <longitudinal_section_columns>
                              <dc:attribute name="description" value="${river} ${a_creation}"/>
-                             <dc:elements>
+                             <dc:for-each>
                                <dc:element name="${facet_name}">
                                  <dc:attribute name="description" value="${facet_description}"/>
                                  <dc:attribute name="ids" value="${facet_num}"/>
@@ -2140,21 +2140,21 @@
                                  <dc:attribute name="artifact-id" value="${a_gid}"/>
                                  <dc:attribute name="out" value="cross_section"/>
                                </dc:element>
-                             </dc:elements>
+                             </dc:for-each>
                            </longitudinal_section_columns>
                          </dc:context>
-                       </dc:elements>
+                       </dc:for-each>
                      </dc:context>
                    </dc:call-macro>
                </dc:context>
-             </dc:elements>
+             </dc:for-each>
           </waterlevels>
         </dc:macro>
 
 
         <dc:macro name="longitudinal">
           <waterlevels>
-            <dc:elements>
+            <dc:for-each>
               <dc:context>
                 <dc:call-macro name="range-filter">
                   <dc:context>
@@ -2163,7 +2163,7 @@
                        FROM outs
                        WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
                      </dc:statement>
-                     <dc:elements>
+                     <dc:for-each>
                        <dc:context>
                          <dc:statement>
                            SELECT name AS facet_name, num as facet_num, description AS facet_description
@@ -2173,7 +2173,7 @@
                          </dc:statement>
                          <longitudinal_section_columns>
                              <dc:attribute name="description" value="${river} ${a_creation}"/>
-                             <dc:elements>
+                             <dc:for-each>
                                <dc:element name="${facet_name}">
                                  <dc:attribute name="description" value="${facet_description}"/>
                                  <dc:attribute name="ids" value="${facet_num}"/>
@@ -2181,21 +2181,21 @@
                                  <dc:attribute name="artifact-id" value="${a_gid}"/>
                                  <dc:attribute name="out" value="longitudinal_section"/>
                                </dc:element>
-                             </dc:elements>
+                             </dc:for-each>
                          </longitudinal_section_columns>
                        </dc:context>
-                     </dc:elements>
+                     </dc:for-each>
                    </dc:context>
                  </dc:call-macro>
                </dc:context>
-             </dc:elements>
+             </dc:for-each>
           </waterlevels>
         </dc:macro>
 
 
         <dc:macro name="longitudinal-section">
           <waterlevels>
-            <dc:elements>
+            <dc:for-each>
               <dc:context>
                 <dc:call-macro name="range-filter">
                    <dc:context>
@@ -2204,7 +2204,7 @@
                      FROM outs
                      WHERE artifact_id = ${a_id} AND name = 'fix_longitudinal_section_curve'
                    </dc:statement>
-                   <dc:elements>
+                   <dc:for-each>
                      <dc:context>
                      <!-- average und deviation ls_0 . ls_1 ...-->
                        <dc:statement>
@@ -2215,7 +2215,7 @@
                        </dc:statement>
                        <waterlevels>
                          <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
-                         <dc:elements>
+                         <dc:for-each>
                            <dc:element name="${facet_name}">
                              <dc:attribute name="description" value="${facet_description}"/>
                              <dc:attribute name="ids"         value="${facet_num}"/>
@@ -2223,20 +2223,20 @@
                              <dc:attribute name="artifact-id" value="${a_gid}"/>
                              <dc:attribute name="out"         value="fix_longitudinal_section_curve"/>
                            </dc:element>
-                         </dc:elements>
+                         </dc:for-each>
                        </waterlevels>
                      </dc:context>
-                   </dc:elements>
+                   </dc:for-each>
                   </dc:context>
                 </dc:call-macro>
                 </dc:context>
-             </dc:elements>
+             </dc:for-each>
           </waterlevels>
         </dc:macro>
 
         <dc:macro name="delta-wt">
           <waterlevels>
-            <dc:elements>
+            <dc:for-each>
               <dc:context>
                 <dc:call-macro name="range-filter">
                    <dc:context>
@@ -2245,7 +2245,7 @@
                      FROM outs
                      WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve'
                    </dc:statement>
-                   <dc:elements>
+                   <dc:for-each>
                      <dc:context>
                        <dc:statement>
                          SELECT name AS facet_name, num as facet_num, description AS facet_description
@@ -2255,7 +2255,7 @@
                        </dc:statement>
                        <waterlevels>
                          <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
-                         <dc:elements>
+                         <dc:for-each>
                            <dc:element name="${facet_name}">
                              <dc:attribute name="description" value="${facet_description}"/>
                              <dc:attribute name="ids"         value="${facet_num}"/>
@@ -2263,21 +2263,21 @@
                              <dc:attribute name="artifact-id" value="${a_gid}"/>
                              <dc:attribute name="out"         value="fix_deltawt_curve"/>
                            </dc:element>
-                         </dc:elements>
+                         </dc:for-each>
                        </waterlevels>
                      </dc:context>
-                   </dc:elements>
+                   </dc:for-each>
                   </dc:context>
                 </dc:call-macro>
                 </dc:context>
-             </dc:elements>
+             </dc:for-each>
           </waterlevels>
         </dc:macro>
 
 
         <dc:macro name="fix-derivate-curve">
           <waterlevels>
-            <dc:elements>
+            <dc:for-each>
               <dc:context>
                 <dc:call-macro name="range-filter">
                    <dc:context>
@@ -2286,7 +2286,7 @@
                      FROM outs
                      WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve'
                    </dc:statement>
-                   <dc:elements>
+                   <dc:for-each>
                      <dc:context>
                        <dc:statement>
                          SELECT name AS facet_name, num as facet_num, description AS facet_description
@@ -2296,7 +2296,7 @@
                        </dc:statement>
                        <waterlevels>
                          <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
-                         <dc:elements>
+                         <dc:for-each>
                            <dc:element name="${facet_name}">
                              <dc:attribute name="description" value="${facet_description}"/>
                              <dc:attribute name="ids"         value="${facet_num}"/>
@@ -2304,21 +2304,21 @@
                              <dc:attribute name="artifact-id" value="${a_gid}"/>
                              <dc:attribute name="out"         value="fix_derivate_curve"/>
                            </dc:element>
-                         </dc:elements>
+                         </dc:for-each>
                        </waterlevels>
                      </dc:context>
-                   </dc:elements>
+                   </dc:for-each>
                   </dc:context>
                 </dc:call-macro>
                 </dc:context>
-             </dc:elements>
+             </dc:for-each>
           </waterlevels>
         </dc:macro>
 
 
         <dc:macro name="fix-wq-curve">
           <waterlevels>
-            <dc:elements>
+            <dc:for-each>
               <dc:context>
                 <dc:call-macro name="range-filter">
                    <dc:context>
@@ -2327,7 +2327,7 @@
                      FROM outs
                      WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve'
                    </dc:statement>
-                   <dc:elements>
+                   <dc:for-each>
                      <dc:context>
                        <dc:statement>
                          SELECT name AS facet_name, num as facet_num, description AS facet_description
@@ -2337,7 +2337,7 @@
                        </dc:statement>
                        <waterlevels>
                          <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
-                         <dc:elements>
+                         <dc:for-each>
                            <dc:element name="${facet_name}">
                              <dc:attribute name="description" value="${facet_description}"/>
                              <dc:attribute name="ids"         value="${facet_num}"/>
@@ -2345,21 +2345,21 @@
                              <dc:attribute name="artifact-id" value="${a_gid}"/>
                              <dc:attribute name="out"         value="fix_wq_curve"/>
                            </dc:element>
-                         </dc:elements>
+                         </dc:for-each>
                        </waterlevels>
                      </dc:context>
-                   </dc:elements>
+                   </dc:for-each>
                   </dc:context>
                 </dc:call-macro>
                 </dc:context>
-             </dc:elements>
+             </dc:for-each>
           </waterlevels>
         </dc:macro>
 
 
         <dc:macro name="duration-curve">
           <computed_discharge_curves>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:call-macro name="range-filter">
                       <dc:context>
@@ -2368,7 +2368,7 @@
                           FROM outs as o, facets as f, artifacts as a
                           WHERE (f.name = 'duration_curve.q' or f.name = 'duration_curve.w') and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:element name="${facet_name}">
                             <dc:attribute name="description" value="${facet_description}"/>
                             <dc:attribute name="factory"     value="winfo"/>
@@ -2376,11 +2376,11 @@
                             <dc:attribute name="ids"         value="${aid}"/>
                             <dc:attribute name="out"         value="duration_curve"/>
                           </dc:element>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                     </dc:call-macro>
                 </dc:context>
-            </dc:elements>
+            </dc:for-each>
           </computed_discharge_curves>
         </dc:macro>
 
@@ -2392,7 +2392,7 @@
 
         <dc:macro name="waterlevels-fix">
           <waterlevels>
-            <dc:elements>
+            <dc:for-each>
               <dc:context>
                 <dc:call-macro name="range-filter">
                    <dc:context>
@@ -2401,7 +2401,7 @@
                      FROM outs
                      WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
                    </dc:statement>
-                   <dc:elements>
+                   <dc:for-each>
                      <dc:context>
                        <dc:statement>
                          SELECT name AS facet_name, num as facet_num, description AS facet_description
@@ -2411,7 +2411,7 @@
                        </dc:statement>
                        <waterlevels>
                          <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
-                         <dc:elements>
+                         <dc:for-each>
                            <dc:element name="${facet_name}">
                              <dc:attribute name="description" value="${facet_description}"/>
                              <dc:attribute name="ids"         value="${facet_num}"/>
@@ -2419,14 +2419,14 @@
                              <dc:attribute name="artifact-id" value="${a_gid}"/>
                              <dc:attribute name="out"         value="longitudinal_section"/>
                            </dc:element>
-                         </dc:elements>
+                         </dc:for-each>
                        </waterlevels>
                      </dc:context>
-                   </dc:elements>
+                   </dc:for-each>
                   </dc:context>
                 </dc:call-macro>
                 </dc:context>
-             </dc:elements>
+             </dc:for-each>
           </waterlevels>
         </dc:macro>
 
@@ -2437,7 +2437,7 @@
 
         <dc:macro name="flood-map">
           <floodmap>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:call-macro name="range-filter">
                       <dc:context>
@@ -2446,7 +2446,7 @@
                           FROM outs as o, facets as f, artifacts as a
                           WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
                         </dc:statement>
-                        <dc:elements>
+                        <dc:for-each>
                           <dc:element name="${facet_name}">
                             <dc:attribute name="description" value="${facet_description}"/>
                             <dc:attribute name="factory"     value="winfo"/>
@@ -2454,11 +2454,11 @@
                             <dc:attribute name="ids"         value="${aid}"/>
                             <dc:attribute name="out"         value="floodmap"/>
                           </dc:element>
-                        </dc:elements>
+                        </dc:for-each>
                       </dc:context>
                   </dc:call-macro>
                 </dc:context>
-            </dc:elements>
+            </dc:for-each>
           </floodmap>
         </dc:macro>
 
@@ -2468,7 +2468,7 @@
 
         <dc:macro name="bed-difference">
           <fix_longitudinal_section_curve>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:call-macro name="range-filter">
                       <dc:context>
@@ -2481,7 +2481,7 @@
                         </dc:statement>
                         <fix_longitudinal_section_curve>
                             <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
-                            <dc:elements>
+                            <dc:for-each>
                             <dc:element name="${facet_name}">
                                 <dc:attribute name="description" value="${facet_description}"/>
                                 <dc:attribute name="factory"     value="fixanalysis"/>
@@ -2489,12 +2489,12 @@
                                 <dc:attribute name="ids"         value="${facet_num}"/>
                                 <dc:attribute name="out"         value="fix_longitudinal_section_curve"/>
                             </dc:element>
-                            </dc:elements>
+                            </dc:for-each>
                         </fix_longitudinal_section_curve>
                         </dc:context>
                     </dc:call-macro>
                 </dc:context>
-            </dc:elements>
+            </dc:for-each>
           </fix_longitudinal_section_curve>
         </dc:macro>
 
@@ -2504,7 +2504,7 @@
 
         <dc:macro name="bed-height">
           <fix_vollmer_wq_curve>
-            <dc:elements>
+            <dc:for-each>
                 <dc:context>
                   <dc:call-macro name="range-filter">
                       <dc:context>
@@ -2516,7 +2516,7 @@
                         </dc:statement>
                         <fix_vollmer_wq_curve>
                             <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
-                            <dc:elements>
+                            <dc:for-each>
                                 <dc:element name="${facet_name}">
                                     <dc:attribute name="description" value="${facet_description}"/>
                                     <dc:attribute name="factory"     value="fixanalysis"/>
@@ -2524,12 +2524,12 @@
                                     <dc:attribute name="ids"         value="${facet_num}"/>
                                     <dc:attribute name="out"         value="longitudinal_section"/>
                                 </dc:element>
-                            </dc:elements>
+                            </dc:for-each>
                         </fix_vollmer_wq_curve>
                         </dc:context>
                     </dc:call-macro>
                 </dc:context>
-            </dc:elements>
+            </dc:for-each>
           </fix_vollmer_wq_curve>
         </dc:macro>
 
@@ -2540,7 +2540,7 @@
                       FROM outs
                       WHERE artifact_id = ${a_id} AND name = 'floodmap'
                     </dc:statement>
-                    <dc:elements>
+                    <dc:for-each>
                       <dc:context>
                         <dc:statement>
                           SELECT name AS facet_name, num as facet_num, description AS facet_description
@@ -2549,7 +2549,7 @@
                           ORDER BY num ASC, name DESC
                         </dc:statement>
                         <own-hws>
-                          <dc:elements>
+                          <dc:for-each>
                             <dc:element name="${facet_name}">
                               <dc:attribute name="description" value="${facet_description}"/>
                               <dc:attribute name="ids"         value="${facet_num}"/>
@@ -2557,10 +2557,10 @@
                               <dc:attribute name="artifact-id" value="${a_gid}"/>
                               <dc:attribute name="out"         value="floodmap"/>
                             </dc:element>
-                          </dc:elements>
+                          </dc:for-each>
                         </own-hws>
                       </dc:context>
-                    </dc:elements>
+                    </dc:for-each>
                   </dc:context>
         </dc:macro>
         <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))">

http://dive4elements.wald.intevation.org