2014-12-22 01:53:18 +00:00
|
|
|
<?xml version="1.0"?>
|
2014-12-26 14:11:36 +00:00
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
xmlns:xt="http://www.jclark.com/xt"
|
|
|
|
extension-element-prefixes="xt" version="1.0">
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:strip-space elements="*"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
<xsl:param name="units" select="units"/>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:output method="text" encoding="UTF-8"/>
|
|
|
|
|
2015-01-24 15:03:13 +00:00
|
|
|
<xsl:variable name="fs"><xsl:text> </xsl:text></xsl:variable>
|
|
|
|
<xsl:variable name="lf"><xsl:text>
|
|
|
|
</xsl:text></xsl:variable>
|
2014-12-22 01:53:18 +00:00
|
|
|
|
|
|
|
<xsl:template match="/divelog/dives">
|
2020-05-31 11:45:11 +00:00
|
|
|
<xsl:variable name="cylinders">
|
|
|
|
<xsl:value-of select="count(dive[position()=last()]/cylinder|trip[position()=last()]/dive[position()=last()]/cylinder)"/>
|
|
|
|
</xsl:variable>
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2020-05-18 14:32:41 +00:00
|
|
|
|
|
|
|
<!-- Print beginning of the header -->
|
2020-05-16 08:58:57 +00:00
|
|
|
<xsl:value-of select="concat(
|
|
|
|
'"dive number"',
|
|
|
|
$fs,
|
|
|
|
'"date"',
|
|
|
|
$fs,
|
|
|
|
'"time"',
|
|
|
|
$fs,
|
|
|
|
'"duration (min)"',
|
|
|
|
$fs,
|
2020-05-16 09:17:01 +00:00
|
|
|
'"sac (cuft/min)"',
|
|
|
|
$fs,
|
2020-05-16 08:58:57 +00:00
|
|
|
'"maxdepth (ft)"',
|
|
|
|
$fs,
|
|
|
|
'"avgdepth (ft)"',
|
|
|
|
$fs,
|
|
|
|
'"mode"',
|
|
|
|
$fs,
|
|
|
|
'"airtemp (F)"',
|
|
|
|
$fs,
|
|
|
|
'"watertemp (F)"',
|
2020-05-18 14:32:41 +00:00
|
|
|
$fs)"/>
|
|
|
|
|
|
|
|
<!-- Print cylinder info according to the amount of cylinders in dive -->
|
2020-05-31 11:30:33 +00:00
|
|
|
<xsl:for-each select="dive[position()=last()]/cylinder|trip[position()=last()]/dive[position()=last()]/cylinder">
|
2020-05-18 15:29:37 +00:00
|
|
|
<xsl:value-of select="concat(
|
|
|
|
'"cylinder size (cuft)"',
|
|
|
|
$fs,
|
|
|
|
'"startpressure (psi)"',
|
|
|
|
$fs,
|
|
|
|
'"endpressure (psi)"',
|
|
|
|
$fs,
|
|
|
|
'"o2 (%)"',
|
|
|
|
$fs,
|
|
|
|
'"he (%)"',
|
|
|
|
$fs)"/>
|
|
|
|
</xsl:for-each>
|
2020-05-18 14:32:41 +00:00
|
|
|
|
|
|
|
<!-- Print rest of the header -->
|
|
|
|
<xsl:value-of select="concat(
|
2020-05-16 08:58:57 +00:00
|
|
|
'"location"',
|
|
|
|
$fs,
|
|
|
|
'"gps"',
|
|
|
|
$fs,
|
|
|
|
'"divemaster"',
|
|
|
|
$fs,
|
|
|
|
'"buddy"',
|
|
|
|
$fs,
|
|
|
|
'"suit"',
|
|
|
|
$fs,
|
|
|
|
'"rating"',
|
|
|
|
$fs,
|
|
|
|
'"visibility"',
|
|
|
|
$fs,
|
|
|
|
'"notes"',
|
|
|
|
$fs,
|
|
|
|
'"weight (lbs)"',
|
|
|
|
$fs,
|
|
|
|
'"tags"')"/>
|
2017-07-09 09:31:58 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2020-05-18 14:32:41 +00:00
|
|
|
|
|
|
|
<!-- Print beginning of the header -->
|
|
|
|
<xsl:value-of select="concat(
|
|
|
|
'"dive number"',
|
2020-05-16 08:58:57 +00:00
|
|
|
$fs,
|
|
|
|
'"date"',
|
|
|
|
$fs,
|
|
|
|
'"time"',
|
|
|
|
$fs,
|
|
|
|
'"duration (min)"',
|
|
|
|
$fs,
|
2020-05-16 09:17:01 +00:00
|
|
|
'"sac (l/min)"',
|
|
|
|
$fs,
|
2020-05-16 08:58:57 +00:00
|
|
|
'"maxdepth (m)"',
|
|
|
|
$fs,
|
|
|
|
'"avgdepth (m)"',
|
|
|
|
$fs,
|
|
|
|
'"mode"',
|
|
|
|
$fs,
|
|
|
|
'"airtemp (C)"',
|
|
|
|
$fs,
|
|
|
|
'"watertemp (C)"',
|
2020-05-18 14:32:41 +00:00
|
|
|
$fs)"/>
|
|
|
|
|
|
|
|
<!-- Print cylinder info according to the amount of cylinders in dive -->
|
2020-05-31 11:30:33 +00:00
|
|
|
<xsl:for-each select="dive[position()=last()]/cylinder|trip[position()=last()]/dive[position()=last()]/cylinder">
|
2020-05-18 15:29:37 +00:00
|
|
|
<xsl:value-of select="concat(
|
|
|
|
'"cylinder size (l)"',
|
|
|
|
$fs,
|
|
|
|
'"startpressure (bar)"',
|
|
|
|
$fs,
|
|
|
|
'"endpressure (bar)"',
|
|
|
|
$fs,
|
|
|
|
'"o2 (%)"',
|
|
|
|
$fs,
|
|
|
|
'"he (%)"',
|
|
|
|
$fs)"/>
|
|
|
|
</xsl:for-each>
|
2020-05-18 14:32:41 +00:00
|
|
|
|
|
|
|
<!-- Print rest of the header -->
|
|
|
|
<xsl:value-of select="concat(
|
2020-05-16 08:58:57 +00:00
|
|
|
'"location"',
|
|
|
|
$fs,
|
|
|
|
'"gps"',
|
|
|
|
$fs,
|
|
|
|
'"divemaster"',
|
|
|
|
$fs,
|
|
|
|
'"buddy"',
|
|
|
|
$fs,
|
|
|
|
'"suit"',
|
|
|
|
$fs,
|
|
|
|
'"rating"',
|
|
|
|
$fs,
|
|
|
|
'"visibility"',
|
|
|
|
$fs,
|
|
|
|
'"notes"',
|
|
|
|
$fs,
|
|
|
|
'"weight (kg)"',
|
|
|
|
$fs,
|
|
|
|
'"tags"')"/>
|
2017-07-09 09:31:58 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
2020-05-31 11:45:11 +00:00
|
|
|
<xsl:apply-templates select="dive|trip/dive">
|
|
|
|
<xsl:with-param name="cylinders" select="$cylinders"/>
|
|
|
|
</xsl:apply-templates>
|
2014-12-22 01:53:18 +00:00
|
|
|
</xsl:template>
|
|
|
|
|
2016-03-21 10:08:16 +00:00
|
|
|
<xsl:template match="divesites/site/notes"/>
|
|
|
|
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:template match="dive">
|
2020-05-31 11:45:11 +00:00
|
|
|
<xsl:param name="cylinders"/>
|
|
|
|
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="@number"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="@date"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="@time"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-03-11 20:34:47 +00:00
|
|
|
<xsl:value-of select="substring-before(@duration, ' ')"/>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
2020-05-16 09:17:01 +00:00
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
|
|
|
<xsl:value-of select="format-number(substring-before(@sac, ' ') * 0.035315, '#.##')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="substring-before(@sac, ' ')"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>"</xsl:text>
|
2015-01-05 12:07:53 +00:00
|
|
|
<xsl:choose>
|
2015-01-22 09:33:12 +00:00
|
|
|
<xsl:when test="divecomputer[1]/depth/@mean|divecomputer[1]/depth/@max != ''">
|
2015-01-05 12:07:53 +00:00
|
|
|
<xsl:apply-templates select="divecomputer[1]/depth"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2019-07-13 07:19:39 +00:00
|
|
|
|
2020-05-04 04:40:46 +00:00
|
|
|
<!-- Dive mode -->
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:if test="divecomputer[1]/@dctype != ''">
|
|
|
|
<xsl:value-of select="divecomputer[1]/@dctype"/>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
|
2019-07-13 07:19:39 +00:00
|
|
|
<!-- Air temperature -->
|
2014-12-22 21:04:02 +00:00
|
|
|
<xsl:choose>
|
2019-07-13 07:19:39 +00:00
|
|
|
<xsl:when test="divetemperature/@air != ''">
|
|
|
|
<xsl:call-template name="temperature">
|
|
|
|
<xsl:with-param name="temp" select="divetemperature/@air"/>
|
|
|
|
</xsl:call-template>
|
2014-12-22 21:04:02 +00:00
|
|
|
</xsl:when>
|
2019-07-13 07:19:39 +00:00
|
|
|
<xsl:when test="divecomputer[1]/temperature/@air != ''">
|
|
|
|
<xsl:call-template name="temperature">
|
|
|
|
<xsl:with-param name="temp" select="divecomputer[1]/temperature/@air"/>
|
|
|
|
</xsl:call-template>
|
2015-01-05 12:07:53 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<!-- empty air temperature -->
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
2019-07-13 07:19:39 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
|
|
|
|
<!-- Water temperature -->
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="divetemperature/@water != ''">
|
|
|
|
<xsl:call-template name="temperature">
|
|
|
|
<xsl:with-param name="temp" select="divetemperature/@water"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="divecomputer[1]/temperature/@water != ''">
|
|
|
|
<xsl:call-template name="temperature">
|
|
|
|
<xsl:with-param name="temp" select="divecomputer[1]/temperature/@water"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2015-01-05 12:07:53 +00:00
|
|
|
<!-- water temperature -->
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
2014-12-22 21:04:02 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2019-07-13 07:19:39 +00:00
|
|
|
|
2020-05-18 15:29:37 +00:00
|
|
|
<xsl:for-each select="cylinder">
|
2020-05-31 11:45:11 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$cylinders < position()"/>
|
|
|
|
<xsl:otherwise>
|
2020-05-18 15:29:37 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="@start|@end != ''">
|
|
|
|
<xsl:apply-templates select="."/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
|
|
|
<xsl:value-of select="concat(format-number((substring-before(@size, ' ') div 14.7 * 3000) * 0.035315, '#.#'), '')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="substring-before(@size, ' ')"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="substring-before(../divecomputer[1]/sample[@pressure]/@pressure, ' ') > 0">
|
|
|
|
<xsl:value-of select="concat(format-number((substring-before(../divecomputer[1]/sample[@pressure]/@pressure, ' ') * 14.5037738007), '#'), '')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="''"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="substring-before(../divecomputer[1]/sample[@pressure]/@pressure, ' ')"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="substring-before(../divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') > 0">
|
|
|
|
<xsl:value-of select="concat(format-number((substring-before(../divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 14.5037738007), '#'), '')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="''"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="substring-before(../divecomputer[1]/sample[@pressure][last()]/@pressure, ' ')"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="substring-before(@o2, '%')"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="substring-before(@he, '%')"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2020-05-31 11:45:11 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2020-05-18 15:29:37 +00:00
|
|
|
</xsl:for-each>
|
|
|
|
|
2015-09-06 10:06:14 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<!-- Old location format -->
|
|
|
|
<xsl:when test="location != ''">
|
|
|
|
<xsl:apply-templates select="location"/>
|
|
|
|
<xsl:if test="string-length(location) = 0">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:when>
|
|
|
|
<!-- Format with dive site managemenet -->
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:if test="string-length(@divesiteid) > 0">
|
|
|
|
<xsl:variable name="uuid">
|
|
|
|
<xsl:value-of select="@divesiteid" />
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:value-of select="//divesites/site[@uuid = $uuid]/@name"/>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:if test="string-length(@divesiteid) > 0">
|
|
|
|
<xsl:variable name="uuid">
|
|
|
|
<xsl:value-of select="@divesiteid" />
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:value-of select="//divesites/site[@uuid = $uuid]/@gps"/>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:apply-templates select="divemaster"/>
|
2014-12-22 21:04:06 +00:00
|
|
|
<xsl:if test="string-length(divemaster) = 0">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
</xsl:if>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:apply-templates select="buddy"/>
|
2014-12-22 21:04:06 +00:00
|
|
|
<xsl:if test="string-length(buddy) = 0">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
</xsl:if>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:apply-templates select="suit"/>
|
2014-12-22 21:04:06 +00:00
|
|
|
<xsl:if test="string-length(suit) = 0">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
</xsl:if>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="@rating"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="@visibility"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:apply-templates select="notes"/>
|
2014-12-22 21:04:06 +00:00
|
|
|
<xsl:if test="string-length(notes) = 0">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>""</xsl:text>
|
|
|
|
</xsl:if>
|
2014-12-26 14:11:36 +00:00
|
|
|
|
|
|
|
<xsl:variable name="trimmedweightlist">
|
|
|
|
<xsl:for-each select="weightsystem">
|
|
|
|
<weight>
|
|
|
|
<xsl:value-of select="substring-before(@weight, ' ')"/>
|
|
|
|
</weight>
|
|
|
|
</xsl:for-each>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:if test="weightsystem">
|
2017-02-26 19:21:51 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="concat(format-number((sum(xt:node-set($trimmedweightlist)/node()) div 0.453592), '#.##'), '')"/>
|
2017-02-26 19:21:51 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="concat(sum(xt:node-set($trimmedweightlist)/node()), '')"/>
|
2017-02-26 19:21:51 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-26 14:11:36 +00:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
|
2014-12-26 14:11:37 +00:00
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-09-17 20:02:54 +00:00
|
|
|
<xsl:call-template name="quote">
|
|
|
|
<xsl:with-param name="line" select="substring-before(translate(translate(@tags, $fs, ' '), $lf, ' '), '"')"/>
|
|
|
|
<xsl:with-param name="remaining" select="substring-after(translate(translate(@tags, $fs, ' '), $lf, ' '), '"')"/>
|
2018-10-06 06:24:16 +00:00
|
|
|
<xsl:with-param name="all" select="@tags"/>
|
2018-09-17 20:02:54 +00:00
|
|
|
</xsl:call-template>
|
2014-12-26 14:11:37 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>
|
|
|
|
</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
<xsl:template match="divecomputer/depth">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-31 20:09:35 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="concat(format-number((substring-before(@max, ' ') div 0.3048), '#.##'), '')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="substring-before(@max, ' ')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-31 20:09:35 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="concat(format-number((substring-before(@mean, ' ') div 0.3048), '#.##'), '')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2018-03-12 06:22:59 +00:00
|
|
|
<xsl:value-of select="format-number(substring-before(@mean, ' '), '#.##')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:template>
|
2019-07-13 07:19:39 +00:00
|
|
|
|
|
|
|
<!-- Temperature template -->
|
|
|
|
<xsl:template name="temperature">
|
|
|
|
<xsl:param name="temp"/>
|
|
|
|
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-31 20:09:35 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2019-07-13 07:19:39 +00:00
|
|
|
<xsl:if test="substring-before($temp, ' ') > 0">
|
|
|
|
<xsl:value-of select="concat(format-number((substring-before($temp, ' ') * 1.8) + 32, '0.0'), '')"/>
|
2017-03-13 19:25:43 +00:00
|
|
|
</xsl:if>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2019-07-13 07:19:39 +00:00
|
|
|
<xsl:value-of select="substring-before($temp, ' ')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:template>
|
2019-07-13 07:19:39 +00:00
|
|
|
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:template match="cylinder">
|
2014-12-26 14:11:35 +00:00
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2017-03-14 05:57:05 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="concat(format-number((substring-before(@size, ' ') div 14.7 * 3000) * 0.035315, '#.#'), '')"/>
|
2017-03-14 05:57:05 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="substring-before(@size, ' ')"/>
|
2017-03-14 05:57:05 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-26 14:11:35 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-31 20:09:35 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="concat(format-number((substring-before(@start, ' ') * 14.5037738007), '#'), '')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="substring-before(@start, ' ')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-31 20:09:35 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$units = 1">
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="concat(format-number((substring-before(@end, ' ') * 14.5037738007), '#'), '')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
2017-07-09 09:31:58 +00:00
|
|
|
<xsl:value-of select="substring-before(@end, ' ')"/>
|
2014-12-31 20:09:35 +00:00
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-26 14:11:35 +00:00
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-03-11 20:34:47 +00:00
|
|
|
<xsl:value-of select="substring-before(@o2, '%')"/>
|
2014-12-26 14:11:35 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-03-11 20:34:47 +00:00
|
|
|
<xsl:value-of select="substring-before(@he, '%')"/>
|
2014-12-26 14:11:35 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
2014-12-22 01:53:18 +00:00
|
|
|
</xsl:template>
|
2020-05-18 15:29:37 +00:00
|
|
|
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:template match="location">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="."/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
<xsl:value-of select="@gps"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
<xsl:template match="divemaster">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-09-17 20:02:54 +00:00
|
|
|
<xsl:call-template name="quote">
|
|
|
|
<xsl:with-param name="line" select="substring-before(translate(translate(., $fs, ' '), $lf, ' '), '"')"/>
|
|
|
|
<xsl:with-param name="remaining" select="substring-after(translate(translate(., $fs, ' '), $lf, ' '), '"')"/>
|
2018-10-06 06:24:16 +00:00
|
|
|
<xsl:with-param name="all" select="translate(., $fs, ' ')"/>
|
2018-09-17 20:02:54 +00:00
|
|
|
</xsl:call-template>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
<xsl:template match="buddy">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-09-17 20:02:54 +00:00
|
|
|
<xsl:call-template name="quote">
|
|
|
|
<xsl:with-param name="line" select="substring-before(translate(translate(., $fs, ' '), $lf, ' '), '"')"/>
|
|
|
|
<xsl:with-param name="remaining" select="substring-after(translate(translate(., $fs, ' '), $lf, ' '), '"')"/>
|
2018-10-06 06:24:16 +00:00
|
|
|
<xsl:with-param name="all" select="."/>
|
2018-09-17 20:02:54 +00:00
|
|
|
</xsl:call-template>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
<xsl:template match="suit">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-09-17 20:02:54 +00:00
|
|
|
<xsl:call-template name="quote">
|
|
|
|
<xsl:with-param name="line" select="substring-before(translate(translate(., $fs, ' '), $lf, ' '), '"')"/>
|
|
|
|
<xsl:with-param name="remaining" select="substring-after(translate(translate(., $fs, ' '), $lf, ' '), '"')"/>
|
2018-10-06 06:24:16 +00:00
|
|
|
<xsl:with-param name="all" select="."/>
|
2018-09-17 20:02:54 +00:00
|
|
|
</xsl:call-template>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:template>
|
|
|
|
<xsl:template match="notes">
|
|
|
|
<xsl:value-of select="$fs"/>
|
|
|
|
<xsl:text>"</xsl:text>
|
2018-09-17 20:02:54 +00:00
|
|
|
<xsl:call-template name="quote">
|
|
|
|
<xsl:with-param name="line" select="substring-before(translate(translate(., $fs, ' '), $lf, '\n'), '"')"/>
|
|
|
|
<xsl:with-param name="remaining" select="substring-after(translate(translate(., $fs, ' '), $lf, '\n'), '"')"/>
|
2018-10-06 06:24:16 +00:00
|
|
|
<xsl:with-param name="all" select="translate(translate(., $fs, ' '), $lf, '\n')"/>
|
2018-09-17 20:02:54 +00:00
|
|
|
</xsl:call-template>
|
2014-12-22 01:53:18 +00:00
|
|
|
<xsl:text>"</xsl:text>
|
|
|
|
</xsl:template>
|
2018-09-17 20:02:54 +00:00
|
|
|
|
|
|
|
<xsl:template name="quote">
|
|
|
|
<xsl:param name="line"/>
|
|
|
|
<xsl:param name="remaining"/>
|
2018-10-06 06:24:16 +00:00
|
|
|
<xsl:param name="all"/>
|
2018-09-17 20:02:54 +00:00
|
|
|
|
2018-10-06 06:24:16 +00:00
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$line = ''">
|
|
|
|
<xsl:value-of select="$all"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="concat($line, '"', '"')"/>
|
|
|
|
<xsl:if test="$remaining != ''">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="substring-before($remaining, '"') != ''">
|
|
|
|
<xsl:call-template name="quote">
|
|
|
|
<xsl:with-param name="line" select="substring-before($remaining, '"')"/>
|
|
|
|
<xsl:with-param name="remaining" select="substring-after($remaining, '"')"/>
|
|
|
|
<xsl:with-param name="all" select="$remaining"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$remaining" />
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2018-09-17 20:02:54 +00:00
|
|
|
</xsl:template>
|
2014-12-22 01:53:18 +00:00
|
|
|
</xsl:stylesheet>
|