[PATCH 1/2] UDDF Export: Moved tankdata before samples, as expected in xsd definition.

Martin Long martin at longhome.co.uk
Wed Feb 11 13:20:54 PST 2015


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

diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index d1d46a9..2b6f20e 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -284,6 +284,56 @@
         </xsl:if>
       </informationbeforedive>
 
+      <xsl:for-each select="cylinder">
+        <tankdata>
+          <link>
+            <xsl:attribute name="ref">
+              <xsl:choose>
+                <xsl:when test="@o2 != ''">
+                  <xsl:value-of select="concat('mix', substring-before(@o2, '.'))"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="'mix21'"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </link>
+
+          <xsl:if test="@size">
+
+            <tankvolume>
+              <xsl:value-of select="substring-before(@size, ' ')"/>
+            </tankvolume>
+          </xsl:if>
+          <xsl:choose>
+            <xsl:when test="@start">
+              <tankpressurebegin>
+                <xsl:value-of select="substring-before(@start, ' ') * 100000"/>
+              </tankpressurebegin>
+            </xsl:when>
+            <xsl:otherwise>
+              <tankpressurebegin>
+                <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure]/@pressure[1], ' ') * 100000"/>
+              </tankpressurebegin>
+            </xsl:otherwise>
+          </xsl:choose>
+
+          <xsl:choose>
+            <xsl:when test="@end">
+              <tankpressureend>
+                <xsl:value-of select="substring-before(@end, ' ') * 100000"/>
+              </tankpressureend>
+            </xsl:when>
+            <xsl:otherwise>
+              <tankpressureend>
+                <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
+              </tankpressureend>
+            </xsl:otherwise>
+          </xsl:choose>
+
+        </tankdata>
+      </xsl:for-each>
+      
       <samples>
 
         <xsl:for-each select="divecomputer[1]/event | divecomputer[1]/sample">
@@ -483,56 +533,6 @@
         </xsl:for-each>
       </samples>
 
-      <xsl:for-each select="cylinder">
-        <tankdata>
-          <link>
-            <xsl:attribute name="ref">
-              <xsl:choose>
-                <xsl:when test="@o2 != ''">
-                  <xsl:value-of select="concat('mix', substring-before(@o2, '.'))"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:value-of select="'mix21'"/>
-                </xsl:otherwise>
-              </xsl:choose>
-            </xsl:attribute>
-          </link>
-
-          <xsl:if test="@size">
-
-            <tankvolume>
-              <xsl:value-of select="substring-before(@size, ' ')"/>
-            </tankvolume>
-          </xsl:if>
-          <xsl:choose>
-            <xsl:when test="@start">
-                <tankpressurebegin>
-                  <xsl:value-of select="substring-before(@start, ' ') * 100000"/>
-                </tankpressurebegin>
-            </xsl:when>
-            <xsl:otherwise>
-              <tankpressurebegin>
-                <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure]/@pressure[1], ' ') * 100000"/>
-              </tankpressurebegin>
-            </xsl:otherwise>
-          </xsl:choose>
-
-          <xsl:choose>
-            <xsl:when test="@end">
-                <tankpressureend>
-                  <xsl:value-of select="substring-before(@end, ' ') * 100000"/>
-                </tankpressureend>
-            </xsl:when>
-            <xsl:otherwise>
-              <tankpressureend>
-                <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
-              </tankpressureend>
-            </xsl:otherwise>
-          </xsl:choose>
-
-        </tankdata>
-      </xsl:for-each>
-
       <informationafterdive>
 		<xsl:variable name="trimmedweightlist">
           <xsl:for-each select="weightsystem">
-- 
2.1.0



More information about the subsurface mailing list