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>
This commit is contained in:
Martin Long 2014-12-10 21:30:31 +00:00 committed by Dirk Hohndel
parent c9f927d547
commit 18aa6f5ed8

View file

@ -72,12 +72,21 @@
<xsl:value-of select="."/>
</xsl:attribute>
<personal>
<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>