eXist and mime types

Friday was a bang your head on the desk kind of day. Unfortunately the banging didn’t help much. Most of the head banging involved me trying to get xforms to work without using cocoon.

We are moving beyond the university firewall because I want the opportunity to have former colleagues take a look at what I’ve been doing and to help me troubleshoot if I need it. But I also want to make sure the data processing side of the application is secure, which it is not currently. To do this I am routing all my data processing xqueries through a password authenticating xquery.

I had a lot of trouble getting the xforms functioning in the first place. I have been using cocoon to serve the forms, and while I know I can use cocoon to do session authentication I don’t know how, and would rather just cut cocoon out of the mix entirely if possible. One less thing to keep track of and learn.

So the problem that was arising was that in spite of the xsl:output declaration my forms were coming back with a mime type of html, not the application/xml+xhtml that is required for the forms to work. I had also noticed that none of the pages I was creating using xsl were outputting a doctype declaration although they should have according to my stylesheets (and did when I tested the stylesheets on my machine using oxygen).

I found an answer after much wild goose chasing and searching the eXist listserv. I have been transforming my results from eXist (with the transform:transform function in my xqueries) was passing the information to the xsl processor (Saxon) and then passing it back to eXist. This would be handy if I needed to do additional processing but for most of what I’m doing this seems to be the wrong function to use because eXist then stripped the dtd declaration and serialized all the results as html. The function I should have been using was transform:stream-transform which outputs directly to the ermmm, the web server I guess.

Problem solved. Or mostly, I can now return to the orignal problem that I started with on Friday, which was learning how to write my own xquery functions.


One Response to “eXist and mime types”

  1. Getting xforms and eXist talking « the DIL Says:

    […] This method works fine, but I as stated in an earlier post I wanted to route all my metadata processing XQueries through a password authenticating XQuery. This query calls a series of metadata administrative tasks, including the XForms. […]

Comments are closed.

%d bloggers like this: