[PATCH 2/2] Aggregate multiple weights into UDDF export.

Martin Long martin at longhome.co.uk
Wed Dec 10 13:30:32 PST 2014


Sum together all of the weights recored on a dive to use in the
<leadquantity> tag in UDDF export.

Signed-off-by: Martin Long <martin at longhome.co.uk>
---
 xslt/uddf-export.xslt | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index 9a03256..d4683ee 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -248,8 +248,16 @@
             </xsl:attribute>
           </link>
         </xsl:if>
+        <xsl:variable name="trimmedweightlist">
+          <xsl:for-each select="weightsystem">
+            <weight>
+              <xsl:value-of select="substring-before(@weight, ' ')"/>
+            </weight>
+          </xsl:for-each>
+        </xsl:variable>
         <equipmentused>
-          <leadquantity><xsl:value-of select="substring-before(weightsystem/@weight, ' ')"/>
+          <leadquantity>
+            <xsl:value-of select="sum(xt:node-set($trimmedweightlist)/weight)"/>
           </leadquantity>
         </equipmentused>
       </informationbeforedive>
-- 
1.9.1



More information about the subsurface mailing list