Processing expectations for the refdb DocBook bibliography output

The accepted standard DSSSL and XSL stylesheets for DocBook by Norman Walsh as well as the XSL stylesheets for TEI by Sebastian Rahtz are not designed to handle the complexity of the bibliography formatting requirements of various journals and publishers. refdb strains the limits of SGML and the document types to supply the required structural information, but it takes customized stylesheets to turn this into proper formatting. The refdb package contains sets of DSSSL and XSL stylesheets that were designed for this purpose. They are implemented as driver files for the standard stylesheets. If those stylesheets do not do exactly what you need, you will have to modify them or write new ones from scratch. This chapter briefly explains the design of the output that refdb generates and how this should be processed in your stylesheets.

Note: This section discusses the DocBook output. It is straightforward to transfer this to TEI output. See here for a description of the equivalent TEI elements and attributes.

The general principle of the refdb bibliography is straightforward: Each citation that you want to be treated as a refdb citation needs to have a role attribute with the value "REFDB". Each citation defines at least one xref element. The value of the linkend attribute encodes the ID of the required reference in the database (if you need references in several databases, this attribute can additionally specify the database). refdb uses this information to generate a DocBook bibliography element. This contains an entry for each requested reference. These entries are labelled with ID attributes that match the xref linkend attributes in the text. Each refdb-generated reference entry defines a xreflabel attribute which holds the text that is to be displayed at the position of the corresponding xref elements.

This is all it takes for single and unique citations, i.e. with one xref element per citation element and only one occurrence throughout the text. Both multiple occurrences of the same citation in the text and multiple citations (more than one xref elements per citation element) make things a bit more difficult.

Some output formats require a different formatting for the first citation of a publication in the text and all subsequent citations of the same publication. The first citation is identical with the above mentioned default case. All following citations of the same publication need an additional xref endterm attribute which points to an additional bibliomset element which in turn contains the text to be displayed for subsequent citations. The endterm attribute has the same value as the linkend attribute except that the letter "S" (as in subsequent) is appended to the attribute.

The real trouble starts with multiple citations. The output format may require the sequence of the citations to be sorted, and in the case of a numerical citation style it may require sequences of consecutive citations to be displayed as ranges (e.g. "[5-7]" instead of "[5,6,7]"). This may break the links between the individual citations and the reference in the bibliography in the output document. refdb will create an additional bibliomset element for each multiple citation. This provides the sorted and formatted text that is to be displayed for the multiple citation. For this to work you have to define an additional xref element whose linkend attribute points to one of the references and whose endterm points to the additional bibliomset element. This arrangement allows the multiple citation to be displayed differently depending on the desired output format. If the output is generated for printout, only the additional xref element should be formatted. This ensures the correct formatting of the citation in the printout. In output formats that allow hyperlinks it may be preferable to format the xref elements that link to the references individually. This may be incorrect in terms of the citation style, but the functional links to the references in the bibliography may outweigh this disadvantage.