[PATCH] Only print separator when really needed on import

Miika Turkia miika.turkia at gmail.com
Sat Mar 16 00:42:13 PDT 2013


The separator was printed if SITE had data, even if LOCATION was empty.
Now print the separator only if both of these contain data.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 xslt/divelogs.xslt |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/xslt/divelogs.xslt b/xslt/divelogs.xslt
index c0585a5..32a59c3 100644
--- a/xslt/divelogs.xslt
+++ b/xslt/divelogs.xslt
@@ -45,14 +45,8 @@
       </depth>
       <location>
         <xsl:for-each select="LOCATION|SITE">
-          <xsl:choose>
-            <xsl:when test="following-sibling::SITE[1] != ''">
-              <xsl:value-of select="concat(., ' / ')"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="."/>
-            </xsl:otherwise>
-          </xsl:choose>
+          <xsl:value-of select="."/>
+          <xsl:if test=". != '' and following-sibling::*[1] != ''"> / </xsl:if>
         </xsl:for-each>
       </location>
 
-- 
1.7.9.5



More information about the subsurface mailing list