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] Collecting glossentries in glossary database

Georges Schmitz wrote:
> Finally I got something working in HTML and I hope, that there are only 
> some small changes required, to get it working with FO too (I think 
> Jirka Kosek was the last one working on glossary.xsl, perhaps he can 
> point out, what is needed).

$Id$ tag from CVS just shows who touched file last time. I did just 
small fix, you can see it in CVS history: "Fixed bug #1031851. Target of 
link is computed by href.target template."

> I still rely on glossterm/@linkend, the glossary can be (x)included in 
> the document further on, so I have no problems with validating the 
> document. The only problem remaining is with glossseealso. Either it can 
> happen that relevant glossentries are missing, because they didn't 
> appear in the document, but were referenced by a glossseealso, or too 
> many of them appear in the result, because I gather all those, that were 
> referenced by otherterm too. For the moment I work with the latter - I 
> declared the following key:

It shouldn't be too hard to get this working correctly. I assume that 
you are using solely linkend/otherterm to point to glossentries. Given 
following two keys:

<xsl:key name="directly-referenced" match="glossterm[@linkend]" 

<xsl:key name="indirectly-referenced" match="glossseealso[@othertem]" 

you can test whether context node which is some particular glossentry 
should be included:

<xsl:if test="key('directly-referenced', @id) or
               (key('directly-referenced', key('indirectly-referenced', 
   ... copy current glossentry ...

>  <xsl:for-each select="exsl:node-set($collected.glossary)/glossary">
>    <xsl:call-template name="make-glossary"/>
>  </xsl:for-each>
> </xsl:template>
> I tested all this first in a driver stylesheet, then I checked out, how 
> it would fit into the official stylesheets. I copied the two templates 
> into common.xsl (they do not generate output dependent markup) and just 
> extended the existing <xsl:template match="glossary"> with 
> 'name="make-glossary"' - and it worked (in HTML). So actually, their 
> would only be one line to be changed.

Using exsl:node-set() should be conditional if you want to have see 
something like this in standard distribution. Stylesheets should work 
(albeit in limited way) also with XSLT processors that don't support EXSLT.

> 2) the glossseealso problem could bee solved by a two pass copy process

No need, see expression above.

> I can't tell, if my solution is generally working. Eg. as I was looking 
> into the stylesheets, I was astonished, that @id is the only attribute 
> used for key access so far, at least it was the only one I found. Maybe 
> keys are problematic with DocBook stylesheets?

Keys are used very extensively. E.g. see autoidx.xsl code.

   Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
        Podrobný přehled školení http://xmlguru.cz/skoleni/

S/MIME Cryptographic Signature

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