OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Formatting of <glossterm>


Hi Alexey,
Thanks for pointing out this inconsistency. It seems that over time several changes were made to the formatting of inline glossterms, and that one was probably missed. I will fix that for 1.78.1.

However, I don't particularly like that italicseq is hard coded here. That should probably be an attribute-set so it can be more easily customized, especially since it overrides the properties provided by the 'xref.properties' attribute-set. But I'm not going to make that change for 1.78.1.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

--------------------------------------------------
From: "Alexey Neyman" <stilor@att.net>
Sent: Tuesday, January 29, 2013 4:55 PM
To: "DocBook Apps" <docbook-apps@lists.oasis-open.org>
Subject: [docbook-apps] Formatting of <glossterm>

Hi all,

Is there a reason why glossterms in FO output are formatted in italics, EXCEPT
the case where it is linked implicitly by virtue of the term's text (or
@baseform, if specified) and the glossary is internal ($glossary.collection =
'')?

Here is the template from 1.78.0. As you may see, there's only one case where inline.charseq template is called, the rest of cases call inline.italicseq.

Regards,
Alexey.

<xsl:template match="glossterm" name="glossterm">
 <xsl:param name="firstterm" select="0"/>

 <xsl:choose>
<xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
     <xsl:variable name="targets" select="key('id',@linkend)"/>
     <xsl:variable name="target" select="$targets[1]"/>

     <xsl:choose>
       <xsl:when test="$target">
         <fo:basic-link internal-destination="{@linkend}"
                        xsl:use-attribute-sets="xref.properties">
           <xsl:call-template name="inline.italicseq"/>
         </fo:basic-link>
       </xsl:when>
       <xsl:otherwise>
         <xsl:call-template name="inline.italicseq"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:when>

   <xsl:when test="not(@linkend)
                   and ($firstterm.only.link = 0 or $firstterm = 1)
                   and ($glossterm.auto.link != 0)
                   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:choose>
     </xsl:variable>
     <xsl:variable name="cterm"

select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>

     <xsl:choose>
       <xsl:when test="not($cterm)">
         <xsl:message>
           <xsl:text>There's no entry for </xsl:text>
           <xsl:value-of select="$term"/>
           <xsl:text> in </xsl:text>
           <xsl:value-of select="$glossary.collection"/>
         </xsl:message>
         <xsl:call-template name="inline.italicseq"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:variable name="id">
           <xsl:call-template name="object.id">
             <xsl:with-param name="object" select="$cterm"/>
           </xsl:call-template>
         </xsl:variable>
         <fo:basic-link internal-destination="{$id}"
                        xsl:use-attribute-sets="xref.properties">
           <xsl:call-template name="inline.italicseq"/>
         </fo:basic-link>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:when>

   <xsl:when test="not(@linkend)
                   and ($firstterm.only.link = 0 or $firstterm = 1)
                   and $glossterm.auto.link != 0">
     <xsl:variable name="term">
       <xsl:choose>
         <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="targets"
                   select="key('glossentries', $term)"/>
     <xsl:variable name="target" select="$targets[1]"/>

     <xsl:choose>
       <xsl:when test="count($targets)=0">
         <xsl:message>
           <xsl:text>Error: no glossentry for glossterm: </xsl:text>
           <xsl:value-of select="."/>
           <xsl:text>.</xsl:text>
         </xsl:message>
         <xsl:call-template name="inline.italicseq"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:variable name="termid">
           <xsl:call-template name="object.id">
             <xsl:with-param name="object" select="$target"/>
           </xsl:call-template>
         </xsl:variable>

         <fo:basic-link internal-destination="{$termid}"
                        xsl:use-attribute-sets="xref.properties">
           <xsl:call-template name="inline.charseq"/>
         </fo:basic-link>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:when>
   <xsl:otherwise>
     <xsl:call-template name="inline.italicseq"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]