A plan for linking references
Posted by mholmes on 19 May 2009 in Activity log
We now have a growing body of references, some already marked up (by EM) and others still in text format (by LCC). We now need to think about how best to link these references into the display of documents. The form of the references looks like this:
<div xml:id="apolon"> <head>Apollon</head> <p> Dieu grec de la lumière. Il est fils de Zeus et de Léto, [...]</p> <listBibl> <bibl> “Apollon.” Le Petit Robert: Dictionnaire illustré des noms propres. 1994. </bibl> <bibl>Second sample bibliographical entry.</bibl> </listBibl> </div>
and they're linked like this:
<ref type="reference" target="references.xml#apolon">Apolon</ref>
There are two approaches we could take:
- The links could call out to some AJAX script which retrieves the reference on the fly from the database, and then shows it on the page. This has the advantage that it's much easier to code on the backend; the only thing that needs to be changed in the rendering code is the XSLT output (to create the link that calls the AJAX script), and the rest is a matter of creating a simple XQuery to grab the item and return it to the page. The disadvantage is likely to be speed (it will take a few seconds for a reference to appear).
- When a document is retrieved from the database, all reference items it links to are also retrieved, and injected into the document somewhere; then the rendering code can make links that work in the same way as the current embedded notes (footnotes). The advantage here is that the page will be more responsive when you're clicking on reference links (no need to wait for an AJAX transaction), but the disadvantage is that the XQuery that retrieves the document needs to dismantle and reconstruct it in order to insert the references into the right place. This is what the Coldesp code does, but in that case it uses the
<back>
element of the<text>
to insert the retrieved items; in the case of our Mariage documents, it's likely that many will have a<back>
element as part of the transcribed document structure, so the reference data will have to go somewhere in the header (presumably). The XQuery that does this is also a bit more tricky and takes a little longer, so initial document display speed would be affected.
I think on balance I should attempt #2, which is in any case probably the more solid alternative when it comes to making coherent standalone XML documents accessible to outside consumers of the site content.
This entry was posted by Martin and filed under Activity log.