Abstract
Bibliofile is a Schema/DTD-independent system for formatting bibliographic citations and references using XSLT. The objective is to bring to XML systems a similar range of formatting support to that available in popular bibliographic database systems like ProCite or BIBTeX.
The Bibliofile system is part of a larger project to identify ways of extending and harmonizing the bibliographic facilities provided in existing DTDs, using the Library of Congress's MODS (Metadata Object Description Schema).
Bibliofile uses a formatting specification file with a small vocabulary designed to represent the styling in accessible terms, eg:
<reftype class="book" aftersep="&period">
<author aftersep=":&space;">
<name>
<surname weight="bold">Anon</surname>
<forename beforesep=",&space;"></forename>
</name>
</author>
<title shape="italic" aftersep="."/>
<publisher beforesep="&space;"/>
<place beforesep=",&space;"/>
<date beforesep=",&space;"/>
<isn type="ISBN" beforesep=",&space;"/>
<url fonttype="monospace" beforesep="&space;[" aftersep="]"></url>
</reftype>
The content models allow for default text (eg Anon in the example) for use where the source element may be absent. Author name specification can occur up to three times, to handle some publishers' differential formatting on first, subsequent, and final authors. Punctuation can be given with character entity names to avoid problems with editors which may pretty-print XML source by breaking lines at spaces in attribute values.
A separate index file (typically one per publisher or journal) holds pointers from the elements used in the formatting specification file to the locations of the actual bibliographic data in a document to be formatted, expressed as XPaths in a set of XSL keys, eg (for DocBook):
<xsl:key
name="biblioentry-book_reftype-author-name.first"
match="//biblioentry/author[1] | //biblioentry/authorgroup/author[1]"
use="ancestor::biblioentry/@id"/>
<xsl:key
name="biblioentry-book_reftype-title"
match="//biblioentry/title"
use="ancestor::biblioentry/@id"/>
The match attribute of the key specification is a Pattern providing one or more XPaths to the source data, but the name is a formatted string conforming to Name syntax which can be parsed to identify both the source data container and reference type (before the underscore) as well as a ladder-like path to the requisite element in the formatting specification (after the underscore).
The Bibliofile processor itself is a small set of named templates which can be included or embedded in the user's own stylesheet. In formatting a list of references, the driving template just has to be called once per bibliographic entry, leaving the user free to decide on any surrounding code (eg a list container). The driver processes the elements for the reference type in the formatting specification file matched by the ladder-like path, and then retrieves the source data using the relevant key and ID value. The output is serialized with any enclosing formatting specified, using a combination of CSS class attributes and hard-coded HTML.
Because the user only has to provide keys to match the relevant element types from the document type in use with the psuedo-paths to the formatting specification, bibliographic data in any DTD or Schema can be formatted without the need to hard-code any XSLT output. A simple tool is provided to generate skeleton keys from a formatting specification file, so that developers just have to fill in the XPaths.
The software has been tested with Saxon, and sample documents are provided in TEI and DocBook as well as MODS format. The code has been released under the terms of the GNU GPL, and discussions take place on the BIBILIOFILE mailing list at lists.ucc.ie. Work is under way to isolate, code, and test examples of more reference types and DTDs, and to implement inline citation and the use of options to handle missing source data. A number of editor vendors with well-developed internal data models have already expressed interest in using it for rendering.
Keywords
![]() ![]() |
Design & Development by deepX Ltd. |