CSL
Citation Style Language
Introduction
CSL provides an easy-to-use but feature-rich XML language to describe bibliographic and citation formatting. It has been developed alongside CiteProc. Analogous to BibTeX .bst files or the binary equivalents in proprietary applications like Endnote, CSL is open, international-ready, and designed on a solid foundation that yields a language that is easy-to-use, while able to flexibly-but-reliably format bibliographies and citations for a wide variety of fields.
Design
CSL is authored in RELAX NG, a schema language that provides unmatched validation power and flexibliity. The schema exploits this functionality to provide tight validation constraints where possible, but flexiblity where desirable, which has two primary benefits. First, it is easier to work with in validating XML editors. Second, the tighter contraints make writing associated software easier.
CSL is based on a notion of citation class, around which all validation is structured. If one is creating or editing a style with an “author-year” class, then, the schema requires definitions for author and year in the citation, but does not allow, for example, details related to a footnote class, with its detailed type-related coding.
In addition, reference types (book, article, etc.) are grouped into structural reference classes. This class-based structure is used to provide a solid fallback system for formatting. For a bibliography list, for example, definitions are required for each of the required reference types among each class: book, chapter, and article. If CiteProc is presented with a record for which it does not have a specific definition, then, it uses the fallback for the class. This allows for a system that is both flexible, as well as reliable.
Here is a fragment of a CSL file:
<bibliography author-as-sort-order="first-author">
<reftype name="book">
<creator>
<names/>
<role>
<prefix> </prefix>
</role>
</creator>
<date>
<year>
<prefix> (</prefix>
<suffix>) </suffix>
</year>
</date>
<title font-style="italic">
<suffix>, </suffix>
</title>
<origin>
<place/>
<publisher>
<prefix>:</prefix>
</publisher>
</origin>
<genre>
<suffix>, </suffix>
</genre>
<medium>
<prefix>(</prefix>
<suffix>)</suffix>
</medium>
<availability>
<physicalLocation>
<suffix>, </suffix>
</physicalLocation>
<url>
<prefix>, </prefix>
</url>
</availability>
</reftype>
The structure is hierarchical, with rendering information wrapped in the appropriate metadata referents. As a result, punctuation and such only gets applied when the metadata is present in the record.
The markup is also designed to be easy to implement in a GUI-based style editor. Here, for example, is the above fragment represented in a web-based mockup:
fragment of CSL editing GUI mockup
CSL relies on features—in particular attribute-based validation, and interleave—currently unsupported in XML Schema. Once that language supports this feature, there will be an XML Schema version of CSL. DTDs will not be supported.
CSL is licensed under the CC-GNU GPL.