aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-12-10 19:44:53 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-10 10:51:57 -0700
commit54d8cee3d86b0a36f405a6b46730ef3086e15c70 (patch)
treec7b60a03891990139b9bde846ae18eb31c7fc169
parent18159b6265696a909875271ffc265160c6a5b2a5 (diff)
downloadsubsurface-54d8cee3d86b0a36f405a6b46730ef3086e15c70.tar.gz
Allow more flexible GPS coordinates for CSV import
This theoretically allows one to use format like 1°36'11.711"N 124°46'00.368"E for GPS coordinates. However, in practice this is not allowed without properly parsing this format in C/C++ side. This patch changes the export format to UTF8 and improves the location import by allowing either gps or location attributes to be imported. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--xslt/manualcsv2xml.xslt16
1 files changed, 9 insertions, 7 deletions
diff --git a/xslt/manualcsv2xml.xslt b/xslt/manualcsv2xml.xslt
index cbfb9ea14..1ad96510f 100644
--- a/xslt/manualcsv2xml.xslt
+++ b/xslt/manualcsv2xml.xslt
@@ -19,7 +19,7 @@
<xsl:param name="notesField" select="notesField"/>
<xsl:param name="weightField" select="weightField"/>
<xsl:param name="dateformat" select="dateformat"/>
- <xsl:output method="xml" indent="yes"/>
+ <xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
</xsl:text></xsl:variable>
@@ -166,9 +166,9 @@
<divecomputerid deviceid="ffffffff" model="csv" />
- <xsl:if test="$locationField >= 0">
+ <xsl:if test="$locationField != '' or $gpsField != ''">
<location>
- <xsl:if test="$gpsField >= 0">
+ <xsl:if test="$gpsField != ''">
<xsl:attribute name="gps">
<xsl:call-template name="getFieldByIndex">
<xsl:with-param name="index" select="$gpsField"/>
@@ -176,10 +176,12 @@
</xsl:call-template>
</xsl:attribute>
</xsl:if>
- <xsl:call-template name="getFieldByIndex">
- <xsl:with-param name="index" select="$locationField"/>
- <xsl:with-param name="line" select="$line"/>
- </xsl:call-template>
+ <xsl:if test="$locationField != ''">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$locationField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:if>
</location>
</xsl:if>