]> 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:30:41 +0000 (19:30 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 20 Nov 2005 19:30:41 +0000 (19:30 +0000)
xsl/fo/xep.xsl

index 7b5867e62e11d76a815830e42f856790fb2243ef..a6c380beeb836fab9588b188feac3b19164e17bf 100644 (file)
   <rx:meta-info>
     <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="rx:meta-field">
         <xsl:attribute name="name">author</xsl:attribute>
         <xsl:attribute name="value">
-          <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:value-of select="normalize-space($author)"/>
         </xsl:attribute>
       </xsl:element>
     </xsl:if>
@@ -58,7 +63,7 @@
     <xsl:element name="rx:meta-field">
       <xsl:attribute name="name">title</xsl:attribute>
       <xsl:attribute name="value">
-        <xsl:value-of select="$title"/>
+        <xsl:value-of select="normalize-space($title)"/>
       </xsl:attribute>
     </xsl:element>
 
@@ -67,7 +72,7 @@
         <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>
@@ -81,7 +86,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>
     <xsl:when test="parent::*">
       <rx:bookmark internal-destination="{$id}">
         <rx:bookmark-label>
-          <xsl:value-of select="$bookmark-label"/>
+          <xsl:value-of select="normalize-space($bookmark-label)"/>
         </rx:bookmark-label>
         <xsl:apply-templates select="*" mode="xep.outline"/>
       </rx:bookmark>
       <xsl:if test="$bookmark-label != ''">
         <rx:bookmark internal-destination="{$id}">
           <rx:bookmark-label>
-            <xsl:value-of select="$bookmark-label"/>
+            <xsl:value-of select="normalize-space($bookmark-label)"/>
           </rx:bookmark-label>
         </rx:bookmark>
       </xsl:if>