Continuing work on TOC
John wants two kinds of change to the TOC:
- Ordering by title should exclude initial articles, and should use special titles for reviews. This will require that he provide me with a sorting title I can use for this purpose, so it's down to him to do that.
- The single-page TOC to be split into Articles and Reviews.
I got 2) working today:
- There are two new items on the menu, Articles and Reviews, and each points to the same
contents.htm, but with a different search parameter (
contents.xqcode now reads that parameter, and filters the list of documents accordingly. It also includes that parameter value in a
<classCode>element in the
<teiHeader>of the output document, so the XSLT can find it.
site_doc_list_to_toc.xslXSLT now provides a different title based on that parameter (from variables in the
hrefattribute in the link forms the first part of the current page filename, so the correct button ends up being depressed on the menu.
- The sitemap ended up not being modified at all.
This approach was about the third one I tried; it seems the most flexible (future requirements could add new values for the type attribute, and only small modifications would be needed to accommodate them), and doesn't change very much. The only oddity is the fact that on the Reviews page, which consists only of one document type ('review'), there's still a Type header/column. To suppress that would require that we check to see whether there's more than one value in the
<classCode> elements in all the documents in the list. That would be easy with XSLT 2.0, using distinct-values, but it might be a bit of a kludge in 1.0, which is what this project is using. It is possible though, so we might do it in future.