Progress on the TOC
Posted by mholmes on 27 Mar 2007 in Activity log
Worked most of the day building a flexible TOC system which allows sorting (ascending and descending) by title, type, hand and author. The variation in encoding of authors was a little problematic; to get a valid sort, I had to do this:
<xsl:sort order="ascending" select="normalize-space(lower-case(string-join(tei:head/tei:bibl/tei:name[1]//text(), '')))"/>
The hand issue is another interesting problem, because many poems continue in the hand of the poem preceding them, so they don't actually contain a <handShift> element at all; eventually I figured out that what we have to do is go to the end of the poem (its final element), then look back using the preceding axis to find the first handShift that appears:
<xsl:sort order="ascending" select="lower-case(descendant::*[last()]/preceding::tei:handShift[1]/@new)"/>
The TOC page now works, and you can click on the headers to sort the list, although it's all unstyled HTML at the moment.