summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Long <martin@longhome.co.uk>2014-12-10 21:30:31 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-10 14:49:32 -0700
commit18aa6f5ed8a776fba3011360ab57569a01a63940 (patch)
tree909d1ff6a37efa936e83ca1494765fed7dc60c16
parentc9f927d5474cc839eb61bbc2c36469d7eb1a6d19 (diff)
downloadsubsurface-18aa6f5ed8a776fba3011360ab57569a01a63940.tar.gz
Support buddies with only a first name, no surname.
The previous patch would not fill the first name field if there was no second name. This rectifies that. Signed-Off-By: Martin Long <martin@longhome.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--xslt/uddf-export.xslt21
1 files changed, 15 insertions, 6 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index 6468e8927..9a0325689 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -72,12 +72,21 @@
<xsl:value-of select="."/>
</xsl:attribute>
<personal>
- <first_name>
- <xsl:value-of select="substring-before(., ' ')"/>
- </first_name>
- <last_name>
- <xsl:value-of select="substring-after(., ' ')"/>
- </last_name>
+ <xsl:choose>
+ <xsl:when test="contains(., ' ')">
+ <first_name>
+ <xsl:value-of select="substring-before(., ' ')"/>
+ </first_name>
+ <last_name>
+ <xsl:value-of select="substring-after(., ' ')"/>
+ </last_name>
+ </xsl:when>
+ <xsl:otherwise>
+ <first_name>
+ <xsl:value-of select="."/>
+ </first_name>
+ </xsl:otherwise>
+ </xsl:choose>
</personal>
</buddy>
</xsl:for-each>