diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-09-06 13:06:14 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-06 07:40:40 -0700 |
commit | e8df3da9e3110a4e81cba49f02cdda1f35dc57fa (patch) | |
tree | 6cc9f80dac0cb5d698e1c59fdf01b3f2ff182fc7 /xslt/xml2manualcsv.xslt | |
parent | 22cf98bbd7d75832d49111cb6d03a5fee6449e31 (diff) | |
download | subsurface-e8df3da9e3110a4e81cba49f02cdda1f35dc57fa.tar.gz |
CSV export: support for new location management
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/xml2manualcsv.xslt')
-rw-r--r-- | xslt/xml2manualcsv.xslt | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/xslt/xml2manualcsv.xslt b/xslt/xml2manualcsv.xslt index 88762f6a8..d6c1a8b3b 100644 --- a/xslt/xml2manualcsv.xslt +++ b/xslt/xml2manualcsv.xslt @@ -108,13 +108,39 @@ <xsl:text>"</xsl:text> </xsl:otherwise> </xsl:choose> - <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: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> <xsl:apply-templates select="divemaster"/> <xsl:if test="string-length(divemaster) = 0"> <xsl:value-of select="$fs"/> |