More on db and XSLT
Did some more work on the idea of storing XSLT in the database and still using it for transformation. It seems impractical to store the root XSLT file that will be used for the transformation in the database; things work better from the point of view of Cocoon pipelines if that's in the filesystem. However, that's not a major problem, because the kinds of things we want to store in the db are string variables and attribute sets, so they'd most likely be includes anyway. Therefore I've begun testing various ways to import a stylesheet into another stylesheet from the database. This combination of sitemap pipeline and import command works:
<map:match pattern="db/xsl_trans/**.xsl">
<map:generate src="xmldb:exist:///db/teiJournal/xsl_trans/{1}.xsl"/>
<map:serialize type="xml" />
</map:match>
<xsl:import href="http://localhost:8080/cocoon/projects/mholmes/teiJournal/db/xsl_trans/text/globals.xsl" />
The main stylesheet, accessed in the normal way, imports the second stylesheet through a localhost URL, which calls the pipeline, which then transmits the stylesheet from the db as XML.
The obvious disadvantage here is the hard-coded URL; although it's based on localhost, the remaining path structure is too specific. I'm now going to experiment with every variation of relative URL I can think of, to see if I can come up with a workaround.