]> granicus.if.org Git - docbook-dsssl/commitdiff
fix issue #15 whitespace in glossterms with autolink
authorbobstayton <bobs@sagehill.net>
Mon, 9 Jul 2018 21:24:49 +0000 (14:24 -0700)
committerbobstayton <bobs@sagehill.net>
Tue, 10 Jul 2018 19:22:54 +0000 (12:22 -0700)
xsl/fo/inline.xsl

index d9dfa31ace08298c7c09556d2be9e0c26c55bd7e..218e7f8fc4f6a1df3d69ac26e0fd0c653f24ab3d 100644 (file)
                     and $glossary.collection != ''">
       <xsl:variable name="term">
         <xsl:choose>
-          <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
-          <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+          <xsl:when test="@baseform">
+            <xsl:value-of select="normalize-space(@baseform)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="normalize-space(.)"/>
+          </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
       <xsl:variable name="cterm"
-           select="(document($glossary.collection,.)//d:glossentry[d:glossterm=$term])[1]"/>
+           select="(document($glossary.collection,.)//d:glossentry[normalize-space(d:glossterm)=$term])[1]"/>
 
       <xsl:choose>
         <xsl:when test="not($cterm)">
         <xsl:when test="count($targets)=0">
           <xsl:message>
             <xsl:text>Error: no glossentry for glossterm: </xsl:text>
-            <xsl:value-of select="."/>
+            <xsl:value-of select="normalize-space(.)"/>
             <xsl:text>.</xsl:text>
           </xsl:message>
           <xsl:call-template name="inline.italicseq"/>