0

In Exist 2.2, When I try to access any .xpl files with REST GET, I get the following error:

/db/beheer/pipe.xpl err:XPST0003 error found while loading module xproc: Error while loading module http://xproc.net/xproc: unexpected token: ! (while expecting closing tag for element constructor: null) [at line 1, column 2]

It seems to me that Exist is processing the *.xpl as if it was something it could execute (like a stored xquery) but then it cannot do so and returns an error.

Is there an easy way to let it return just the XML (the XProc as is instead of error message)?

M_breeb
  • 195
  • 1
  • 9

1 Answers1

2

Indeed, eXist consults its list of Internet Media Types when you do a HTTP GET using the REST Server and if it thinks that it is an XProc it will attempt to execute it as such.

You can change what eXist thinks is an XProc by editing $EXIST_HOME/mime-type.xml and then restarting eXist. You most likely want to move the .xpl extension from the mimetype application/xml+xproc to application/xml.

adamretter
  • 3,885
  • 2
  • 23
  • 43
  • Thank you Adam, this works for new documents (not for the ones that were already in the database) – M_breeb Nov 24 '14 at 20:29
  • Ah right yes, that is because the Internet Media Type is set in the documents metadata when it is stored into the database. If you want to update the resources you already have, you could write an XQuery which traverses the collections and documents and calls the `xmldb:set-mime-type` function to update them. – adamretter Nov 24 '14 at 22:13