diff options
Diffstat (limited to 'xslt/shearwater.xslt')
-rw-r--r-- | xslt/shearwater.xslt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xslt/shearwater.xslt b/xslt/shearwater.xslt index 2bbe5643d..0c655ade0 100644 --- a/xslt/shearwater.xslt +++ b/xslt/shearwater.xslt @@ -3,6 +3,8 @@ <xsl:output method="xml" indent="yes"/> <xsl:include href="commonTemplates.xsl"/> + <xsl:key name="gases" match="diveLogRecord" use="concat(fractionO2, '/', fractionHe)" /> + <xsl:template match="/"> <divelog program='subsurface-import' version='2'> <dives> @@ -74,6 +76,24 @@ </xsl:attribute> </divecomputer> + <xsl:for-each select="diveLogRecords/diveLogRecord[generate-id() = generate-id(key('gases', concat(fractionO2, '/', fractionHe))[1])]"> + <xsl:if test="currentCircuitSetting = 1"> + <cylinder> + <xsl:attribute name="description"> + <xsl:value-of select="concat(fractionO2 * 100, '/', fractionHe * 100)"/> + </xsl:attribute> + <xsl:attribute name="o2"> + <xsl:value-of select="concat(fractionO2 * 100, '%')"/> + </xsl:attribute> + <xsl:if test="fractionHe != 0"> + <xsl:attribute name="he"> + <xsl:value-of select="concat(fractionHe * 100, '%')"/> + </xsl:attribute> + </xsl:if> + </cylinder> + </xsl:if> + </xsl:for-each> + <xsl:for-each select="diveLogRecords/diveLogRecord"> <sample> <xsl:attribute name="time"> |