Dear all,

 

currently I’m facing following problem:

 

1)      Saxon9he.jar stored in “lib” folder (to ensure XSLT 2.0) of a local BaseX instance (Windows)

2)      Xquery calls a transformation xslt:transform($doc, $xsl)

3)      Within this stylesheet I try to address another resource stored in the same database

 

Background: XML contains product information and refers to certain other XML resources like authors, serials etc.

 

I guess I have to options:

1)      Refer to document directly (database path)

 

Here I used doc() and referred to the additional documents, e.g. doc(‘/serials/serial-123.xml’). Unfortunately, the transformation says that the file or directory does not exist.

 

I played a while around with doc() and collection() but could not find a way to make it work. Maybe the reason is that saxon runs outside the database and does not know about the database context.

 

2)      Use rest service

 

Afterwards I tried to use the rest interface. Given the example before I used http://admin:admin@localhost:8984/rest/serials/serial-123.xml (user and pw are admin).

Checked that simple with a browser – worked. The transformation instead didn’t work – it returned a 401 unauthorized http response.

 

So, my question is how to read in database documents in an XSL stylesheet? And why does my http request does not work?

 

Best,

Oliver