Worked all day to write XSLT to convert the P4 in this project to P5. There are two purposes to this:
- Provide P5 source XML on the site, for future-proofing.
- Create P5 articles we can use when working on a future publishing project.
Began by looking at the sample fragments on the TEI Wiki; their approach is to string together lots of tiny stylesheets which each deal in detail with one item or element. That's too complicated for our situation, where our P4 is quite simple.
Built my own stylesheet from scratch, and finally got all articles validating against a P5 schema created from ROMA. In the process I found and fixed some inconsistencies in the original article markup (mainly ambiguous date formats).
Then I added a pipeline to the sitemap to generate the P5 output for any article. All works OK, except that the final stage in the pipeline, which should add an xmlns attribute to the root element, just doesn't work. I've read around all the relevant lists and sites, followed every suggestion I can find, and tried both XSLT 2.0 and 1.0, but nothing seems to work; there's just no way to add that xmlns attribute to the root of the document. I'll have to post a couple of questions on the gmane XSLT list and on the TEI list and see if anyone can come up with an answer. But this is quite a minor problem.
Next, we add links to the site to view the P5, and test conversion of the teiCorpus document for a full volume to P5.