Reference display bugs fixed
Posted by mholmes on 20 Jan 2011 in Activity log
There were some oddities in the display of references linked from inside references -- see my prior post for details. I've now fixed those. The problems arose because:
- When a reference was linked from inside another reference, it wasn't necessarily already in the page, because only references linked directly from the text are pulled into the document initially. That meant it had to be retrieved by AJAX.
- When it was retrieved by AJAX, it was a fragment rather than a full document; that meant that a lot of the context which was used by XSL matching templates was absent, so a lot of the styling was not applied.
- When the reference was retrieved, it was supposed to be added to the list of existing references. However, it replaced them instead, meaning that all subsequent reference links had to retrieve their references anew -- and they then inherited the style problems described above.
I've now fixed this so that the transformation XSL is more sensitive to fragments (it uses a formula local-name(/*) ne 'TEI'
to identify a fragment, which is typically rooted on <div>
rather than <TEI>
). I've also tweaked the AJAX code so that it can append to the content of the target element as well as replace it, using a switch called clearTargetFirst
.
This entry was posted by Martin and filed under Activity log.