[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Collecting glossentries in glossary database
Thank you for your valuable help, especially the tip of using 2 separate keys and thus calculating two intersections at once seems very elegant to me. Jirka Kosek wrote: >> ... 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]" > use="@linkend"/> > > <xsl:key name="indirectly-referenced" match="glossseealso[@othertem]" > use="@otherterm"/> > > 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', > @id)/../@id))"> > ... copy current glossentry ... > </xsl:if> There was just a small mistake, the last use of the key function should be key('indirectly-referenced', @id)/../../@id)) >> <xsl:for-each select="exsl:node-set($collected.glossary)/glossary"> >> <xsl:call-template name="make-glossary"/> >> </xsl:for-each> >> </xsl:template> >> > 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. To allow for "condionality", would it be enough to perform a test with function-available() and if negative, just processing the original glossary? Because I wouldn't know, how to come around with the problem of using a temporary tree containing a filtered glossary. <xsl:choose> <xsl:when test="function-available('exsl:node-set')"> <xsl:for-each select="exsl:node-set($collected.glossary)/glossary"> <xsl:call-template name="make-glossary"/> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:message>+++ Function 'exsl:node-set()' not available. Processing glossary in ordinary way. +++</xsl:message> <xsl:call-template name="make-glossary"/> </xsl:otherwise> </xsl:choose> I will continue working on it (when I get time), especially introducing some parameter to switch sorting on/off and FO should work too. Thanks for the help so far, Georges
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]