[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Showing keywords on output
Hi Larry,
On Sun, 22 Jul 2012 17:07:03 -0500
Larry Garfield <larry@garfieldtech.com> wrote:
> In my case I'm slightly abusing keywords for categories, [...]
Funny, I did the same. :)
> My source looks something like this:
>
> <article>
> <articleinfo>
> <keywordset>
> <keyword role="service">PC</keyword>
> <keyword role="category">Destroyer</keyword>
> <keyword role="variant">Tactical</keyword>
> <keyword role="mark">II</keyword>
> </keywordset>
> </articleinfo>
> <!-- ... -->
> </article>
>
> At one point in time with an older version of DocBook XSL, I had the
> following customizations working:
>
> <xsl:template match="article//keywordset"
Ok, a minor detail: Better use the XPath expression
"article/*/keywordset". It's a tiny bit faster (you probably won't
notice any difference, but anyway) and more consistent with the current
DocBook structure. A keywordset is allowed only inside articleinfo or
info.
> [...]
> My questions then are:
>
> 1) What's the correct way in "modern" DBXSL to grab the keywords and
> display them at the top of each page?
In my book I have sections and used section.titlepage.before.verso.
That means, the keywords will be placed _after_ the title structure is
processed (that's not what you want).
Here is a short overview in which order all the templates are executed.
A foo() notation denotes a named template (xsl:template name="foo">):
article.titlepage() => called from article
article.titlepage.before.recto() => empty
article.titlepage.recto() => creates the article titlepage
article.titlepage.before.verso() => empty
article.titlepage.verso() => empty
article.titlepage.separator() => returns <hr/>
In your case, you need to customize article.titlepage.before.recto
probably.
> 2) Is there some structure other than keywords that I should be using
> instead that I don't know about, that would be easier to work with?
You could use subjectset, subject, and subjectterm:
http://www.docbook.org/tdg/en/html/subjectset.html
subjectset — A set of terms describing the subject matter of a
document
I assume, you have some more possibilities (like to determine the
scheme and weight) than with keywordsets., -
Currently, as far as I can see, a subjectset is ignored for HTML. If
you use these elements, you have to customize these templates.
In FO the FO stylesheets use them to create meta data.
--
Gruß/Regards,
Thomas Schraitle
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]