Port completed
Posted by mholmes on 06 Feb 2007 in Activity log
Solved a number of problems, leading to successful rendering of all documents on the new site (which is here).
The first problem was the non-display of any content when using the strip-namespaces stylesheet at the end of a pipeline. This stylesheet is, in any case, a kludge, arising from the difficulties we've had making various xslt engines behave reliably with regard to the output of unnecessary or unwanted xmlns attributes. I removed that from the pipeline, and found a way to stop the attributes from appearing in the first place:
- Use XSLT 2 and Saxon 8.
- Include xmlns="http://www.w3.org/1999/xhtml" in the root element of all stylesheet files included in the transformation process.
- Output all html elements using the xsl:element constructor; don't use literal output.
- Us xsl:output method="xhtml", with an xhtml doctype and xpath-default-namespace, like this:
<xsl:output method="xhtml" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" xpath-default-namespace="http://www.w3.org/1999/xhtml" />
- Construct the root element with a namespace attribute, like this: <xsl:element name="html" namespace="http://www.w3.org/1999/xhtml">
- Use xpath-default-namespace="http://www.tei-c.org/ns/1.0" wherever you want to avoid having to use the tei prefix. This is only slightly more convenient; actually, it might be better to be explicit about prefixes when matching, as I have been in most places. I should test the results of removing these calls.
- Serialize as "xhtml11_compat". Unfortunately, if we use the Cocoon xhtml11 option, even Firefox fails to render it quite right (ignoring the background image). This needs some diagnosis, but it isn't major. It's a little odd, because the rest of the site (not documents from the db) works fine serialized through xhtml11, but then again it's being produced by a different block of XSLT, which is 1.0 and processed by Xalan.
At this point, the whole site is working and I can go on to constructing the search system.