Implemented reference linking
Posted by mholmes on 19 May 2009 in Activity log
Implemented the second option for reference linking, and got it all working. Briefly:
- When the XQuery retrieves a document from the db, it checks for
<ref type="reference">tags. If it finds any, it creates a<back>element containing a<div type="references">element. - For each ref link it finds in the document, it retrieves the matching reference
<div>from the references subcollection and puts it into the<div>above. This means the XML document now has a matching explanatory text for each unique reference in its back matter. - The XSLT then detects the presence of these, and turns each
<ref>tag into a link which calls some JavaScript. - The JavaScript pops up the reference information on the right of the screen.
The display of reference info looks very similar to that of note info, but it's not; the notes are displayed through pure CSS using :target, but the references cannot be set to position: fixed because they're frequently very long and need to scroll, so they're set to position: absolute and just placed next to the calling reference link.