]> granicus.if.org Git - docbook-dsssl/commitdiff
Added normalize-space() to text values in document properties.
authorBob Stayton <bobs@sagehill.net>
Sun, 20 Nov 2005 19:31:14 +0000 (19:31 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 20 Nov 2005 19:31:14 +0000 (19:31 +0000)
Handle author better, the same as xep.xsl.

xsl/fo/axf.xsl

index 1e9db5c0f2b58172ac695c5f804e354ca11547d6..32a93fd7aacc273f0d60ec333a52c89ca8bba0cc 100644 (file)
 
 <xsl:template name="axf-document-information">
 
-    <xsl:if test="//author[1]">
+    <xsl:variable name="authors" select="(//author|//editor|
+                                          //corpauthor|//authorgroup)[1]"/>
+    <xsl:if test="$authors">
+      <xsl:variable name="author">
+        <xsl:choose>
+          <xsl:when test="$authors[self::authorgroup]">
+            <xsl:call-template name="person.name.list">
+              <xsl:with-param name="person.list" 
+                 select="$authors/*[self::author|self::corpauthor|
+                               self::othercredit|self::editor]"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:when test="$authors[self::corpauthor]">
+            <xsl:value-of select="$authors"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="person.name">
+              <xsl:with-param name="node" select="$authors"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
       <xsl:element name="axf:document-info">
         <xsl:attribute name="name">author</xsl:attribute>
         <xsl:attribute name="value">
-          <xsl:call-template name="person.name">
-            <xsl:with-param name="node" select="//author[1]"/>
-          </xsl:call-template>
+          <xsl:value-of select="normalize-space($author)"/>
         </xsl:attribute>
       </xsl:element>
     </xsl:if>
       <xsl:apply-templates select="/*[1]" mode="title.markup"/>
     </xsl:variable>
 
-    <axf:document-info name="title" value="{$title}"/>
+    <axf:document-info>
+      <xsl:attribute name="title">
+        <xsl:value-of select="normalize-space($title)"/>
+      </xsl:attribute>
+    </axf:document-info>
 
     <xsl:if test="//keyword">
       <xsl:element name="axf:document-info">
         <xsl:attribute name="name">keywords</xsl:attribute>
         <xsl:attribute name="value">
           <xsl:for-each select="//keyword">
-            <xsl:value-of select="."/>
+            <xsl:value-of select="normalize-space(.)"/>
             <xsl:if test="position() != last()">
               <xsl:text>, </xsl:text>
             </xsl:if>
@@ -47,7 +71,7 @@
         <xsl:attribute name="name">subject</xsl:attribute>
         <xsl:attribute name="value">
           <xsl:for-each select="//subjectterm">
-            <xsl:value-of select="."/>
+            <xsl:value-of select="normalize-space(.)"/>
             <xsl:if test="position() != last()">
               <xsl:text>, </xsl:text>
             </xsl:if>