diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-18 21:33:00 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-19 19:44:37 -0800 |
commit | f1f02941c7a8e538db18e10f4937170024d3405e (patch) | |
tree | 708cafb2bb85f373d2729fe3ed52a6d4c8025aee /xslt | |
parent | aa7f2eeb8a1a46211b52b9c97e3f040c2f1a5ab8 (diff) | |
parent | 554b652d25d9ce853c4f8f2044f80ab1b198fb1b (diff) | |
download | subsurface-f1f02941c7a8e538db18e10f4937170024d3405e.tar.gz |
Merge branch 'v4.4-branch' back into master
The manuals all will need a careful read.
The changes to use lsb-release and the PCLinuxOS specific files got lost
because I didn't want to try to rewite this in the middle of a merge.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Conflicts:
Documentation/50-pot/subsurface-manual.pot
Documentation/fr/po/subsurface-manual.fr.po
Documentation/user-manual.txt
Documentation/user-manual_es.txt
Documentation/user-manual_fr.html.git
Documentation/user-manual_fr.txt
Documentation/user-manual_ru.html.git
Documentation/user-manual_ru.txt
file.c
qthelper.cpp
subsurface.pro
subsurfacesysinfo.cpp
xslt/DiveLog.xslt
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/DiveLog.xslt | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/xslt/DiveLog.xslt b/xslt/DiveLog.xslt index b4bab8905..b94e28796 100644 --- a/xslt/DiveLog.xslt +++ b/xslt/DiveLog.xslt @@ -2,17 +2,31 @@ <xsl:strip-space elements="*"/> <xsl:output method="xml" indent="yes"/> + <xsl:key name="DC" match="dive" use="concat(@ComputerID, ':', @Computer)"/> + <xsl:template match="/"> <divelog program='subsurface-import' version='2'> <settings> - <divecomputerid deviceid="ffffffff"> + <!-- Using the serial number as device ID for now. Once we have + a change to get some testing done, we can jump on using + extension that provides sha1 function. + ++ xmlns:crypto="http://exslt.org/crypto" ++ extension-element-prefixes="crypto" ++ <divecomputerid deviceid="{substring(crypto:sha1(concat(@ComputerID, ':', @Computer)), 1, 8)}"> + +--> + + <xsl:for-each select="logbook/dive[generate-id() = generate-id(key('DC',concat(@ComputerID, ':', @Computer))[1])]"> + <divecomputerid deviceid="{@ComputerID}"> <xsl:attribute name="model"> - <xsl:value-of select="logbook/@program"/> + <xsl:value-of select="@Computer"/> </xsl:attribute> <xsl:attribute name="serial"> - <xsl:value-of select="logbook/@serialNumber"/> + <xsl:value-of select="@ComputerID"/> </xsl:attribute> </divecomputerid> + </xsl:for-each> </settings> <dives> <xsl:apply-templates select="/logbook"/> @@ -62,6 +76,9 @@ <notes> <xsl:value-of select="notes"/> <xsl:value-of select="concat($lf, 'Weather: ', @Weather, $lf, 'Visibility: ', @Visibility)"/> + <xsl:if test="@Boat != '' and @Boat != ' '"> + <xsl:value-of select="concat($lf, 'Boat: ', @Boat)"/> + </xsl:if> </notes> <cylinder> @@ -111,7 +128,7 @@ </xsl:if> </cylinder> - <xsl:if test="@Weight != ''"> + <xsl:if test="@Weight != '' and @Weight != '0.0'"> <weightsystem> <xsl:attribute name="weight"> <xsl:call-template name="weightConvert"> @@ -133,11 +150,22 @@ <xsl:value-of select="@DiveMaster"/> </divemaster> - <divecomputer deviceid="ffffffff"> + <divecomputer deviceid="{@ComputerID}"> + <xsl:attribute name="model"> <xsl:value-of select="@Computer"/> </xsl:attribute> + <extradata key="Sample Interval" value="{@SampleInterval}"/> + + <xsl:if test="@AltitudeMode != ''"> + <extradata key="Altitude Mode" value="{@AltitudeMode}"/> + </xsl:if> + + <xsl:if test="@PersonalMode != ''"> + <extradata key="Personal Mode" value="{@PersonalMode}"/> + </xsl:if> + <depth> <xsl:attribute name="max"> <xsl:call-template name="depthConvert"> |