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] | [Elist Home]


Subject: DOCBOOK-APPS: Sorted Glossary (Solution)


Hi list,
Call me lazy, but I hate to group and sort my glossary. Therefore I just
put them into my document and use XSL to sort them.
Just in case anybody is interested, here it is.

Stephan



Example Glossentry:
   <glossentry id="gloss_OpenPGP">
     <glossterm id="gloss_OpenPGPT">OpenPGP</glossterm>
   <glossdef><para>OpenPGP is the most widely used email encryption
standard in the world. It
   is defined by the OpenPGP Working Group of the Internet Engineering
Task Force (IETF)
   standard RFC 2440. The OpenPGP standard was originally derived from
PGP (Pretty Good
   Privacy), first created by Phil Zimmermann in 1991.
   </para>
   <para>
   The OpenPGP Alliance is a growing group of companies and other
organizations that
   are implementers of the OpenPGP standard. The Alliance works to
facilitate technical
   interoperability and marketing synergy between OpenPGP
implementations.
   </para>
   <para>See <ulink url="http://www.openpgp.org/"; /> for details.</para>
   </glossdef>
   
   </glossentry>


The XSLT:

<xsl:template match="glossdef">
   <xsl:apply-templates/>
</xsl:template>


<xsl:template match="glossary">
   
   <fo:table width="17cm" table-layout="fixed"
      border="0.0pt solid black"
      text-align="left"
    >
    <fo:table-column column-width="3.5cm"/>
    <fo:table-column column-width="13.5cm"/>
      <fo:table-body>
      <xsl:for-each select="glossentry" >
      <xsl:sort select="glossterm | acronym"/>
        <fo:table-row border="0.0pt solid black">
          <fo:table-cell>
            <fo:block vertical-align="middle" hyphenate="false">

               <xsl:value-of select="glossterm" />
            </fo:block>
                           
            <xsl:if test="acronym">
               <fo:block>
                  (<xsl:value-of select="acronym" />)
               </fo:block>
            </xsl:if>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block text-align="justify">
              <xsl:apply-templates select="glossdef" />
            </fo:block>
          </fo:table-cell>
        </fo:table-row >  
      </xsl:for-each>
      </fo:table-body> 
    </fo:table> 


</xsl:template>



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


Powered by eList eXpress LLC