Database design and XSLT issues
Spent most of the day working out the DB design (which is half-documented in a diagram, which I'll post when I've finished it). Before going too far with it, though, I needed to check that it was possible to store XSLT in the database and use it in pipelines. This proved a bit complicated.
You can of course store an XSLT file in the db, because it's just XML. Similarly, you can retrieve it using a <map:generate> or <map:read> element (although the latter is no use for our purposes because it can't be used as input in another pipeline). Another pipeline can reference the XSLT file using the xmldb:/// protocol, and this appears to work OK (at least with the default xslt transformer; using Saxon, things don't quite work, but that's another story). However, any <xsl:include> or <xsl:import> elements in the stylesheet fail, because their relative path is reconstructed using the cocoon:/ protocol, and the XSLT transformer of course knows nothing about that.
We really do need to store XSLT files in the db, because all sorts of user preferences and options will be stored in the form of xslt attribute sets. Perhaps we can use XQuery to compile a complete stylesheet? That actually makes a lot of sense -- that'll be the next thing to figure out.