]> granicus.if.org Git - docbook-dsssl/commitdiff
Support output of language attribute on foreignphrase and fix bug in glossterm linking
authorNorman Walsh <ndw@nwalsh.com>
Sat, 19 Oct 2002 18:59:20 +0000 (18:59 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sat, 19 Oct 2002 18:59:20 +0000 (18:59 +0000)
xsl/html/inline.xsl

index 46e2d2bf2a284523757c2eb5e645a6f55dbb78d5..ee7cab13b2bdd730a88cb907551a50a75dc81cf6 100644 (file)
 </xsl:template>
 
 <xsl:template match="foreignphrase">
-  <xsl:call-template name="inline.italicseq"/>
+  <span class="foreignphrase">
+    <xsl:if test="@lang or @xml:lang">
+      <xsl:call-template name="language.attribute"/>
+    </xsl:if>
+    <xsl:call-template name="inline.italicseq"/>
+  </span>
 </xsl:template>
 
 <xsl:template match="markup">
 
 <xsl:template match="phrase">
   <span>
+    <xsl:if test="@lang or @xml:lang">
+      <xsl:call-template name="language.attribute"/>
+    </xsl:if>
     <xsl:if test="@role and $phrase.propagates.style != 0">
       <xsl:attribute name="class">
         <xsl:value-of select="@role"/>
       <xsl:variable name="term">
         <xsl:choose>
           <xsl:when test="@baseform">
-            <xsl:value-of select="@baseform"/>
+            <xsl:value-of select="normalize-space(@baseform)"/>
           </xsl:when>
           <xsl:otherwise>
-            <xsl:value-of select="."/>
+            <xsl:value-of select="normalize-space(.)"/>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
       <xsl:variable name="targets"
-                    select="//glossentry[glossterm=$term or glossterm/@baseform=$term]"/>
+                    select="//glossentry[normalize-space(glossterm)=$term
+                              or normalize-space(glossterm/@baseform)=$term]"/>
       <xsl:variable name="target" select="$targets[1]"/>
 
       <xsl:choose>