]> granicus.if.org Git - docbook-dsssl/commitdiff
Added user dpawson (Dave Pawson).
authorMauritz Jeanson <mj@johanneberg.com>
Thu, 9 Aug 2007 18:06:57 +0000 (18:06 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Thu, 9 Aug 2007 18:06:57 +0000 (18:06 +0000)
Modified author template so that the username is output if a real name has not been defined.

releasetools/svnlog2docbook.xsl

index 1ba25bc51e70476b2934787cdf758a4b3ba0b26a..d026f141cedef6b4e764f9e8a4ff2363d40e66af 100644 (file)
       <sf:firstname>David</sf:firstname>
       <sf:surname>Cramer</sf:surname>
     </sf:user>
+    <sf:user>
+      <sf:username>dpawson</sf:username>
+      <sf:firstname>Dave</sf:firstname>
+      <sf:surname>Pawson</sf:surname>
+    </sf:user>
     <sf:user>
       <sf:username>kosek</sf:username>
       <sf:firstname>Jirka</sf:firstname>
   </xsl:template>
 
   <xsl:template match="author">
+    <!-- * based on Sourceforge cvs username, get a real name (if one has been defined) 
+        * and use that in the result document, instead of the username -->
     <xsl:variable name="username" select="."/>
-    <!-- * based on Sourceforge cvs username, get a real name and use -->
-    <!-- * that in the result document, instead of the username -->
-    <xsl:value-of
-      select="document('')//sf:users/sf:user[sf:username = $username]/sf:firstname"/>
-    <xsl:text> </xsl:text>
-    <xsl:value-of
-      select="document('')//sf:users/sf:user[sf:username = $username]/sf:surname"/>
+    <xsl:variable name="users" select="document('')//sf:users"/>
+    <xsl:variable name="realname" select="concat($users/sf:user[sf:username = $username]/sf:firstname, 
+                                         ' ',
+                                         $users/sf:user[sf:username = $username]/sf:surname)"/>
+    
+    <xsl:choose>
+      <xsl:when test="string-length($realname) > 1">
+       <xsl:value-of select="$realname"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:value-of select="$username"/>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
+
   <!-- * ============================================================== -->
   <!-- *    Kludges for dealing with dots in/after names                -->
   <!-- * ============================================================== -->