Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calls to doc() in an XSLTSerlvet context executed within the database throw URIResolver errors #1312

Closed
rvdb opened this issue Mar 2, 2017 · 1 comment · Fixed by #1316
Closed
Assignees
Labels
bug issue confirmed as bug
Milestone

Comments

@rvdb
Copy link
Contributor

rvdb commented Mar 2, 2017

What is the problem

When called in an XSLT stylesheet, which is executed via XSLTServlet within the database, the doc() function fails with following error:

SAX exception while transforming node: Exception thrown by URIResolver

Yet, the URI does resolve, and the same XSLT stylesheet is working without errors when called with the transform:transform() function, and when executed via XSLTServlet on the file system.

Moreover, execution order seems to matter (see below).

What did you expect

In the sample app (see below), I'd expect the call to doc('http://localhost:8080/exist/apps/doc-test/test.xml') to be resolved properly, and to get following output from the simple XSLT stylesheet, irrespective of the execution context / order:

<xslt-output><h1>doc() has succeeded!</h1></xslt-output>

Describe how to reproduce or add a test

The zip file attached doc-test.zip contains a sample web application demonstrating the problem, which can be reproduced by following steps:

  1. install the doc-test-0.1.xar file in the database
  2. navigate to http://localhost:8080/exist/apps/doc-test/test-XSLTServlet/

This will cause an HTTP ERROR 500, stating that

An error occurred: SAX exception while transforming node: Exception thrown by URIResolver

Additional remarks:

1. execution context matters

The error only occurs when the XSLT transformation is executed via XSLTServlet within the database.

2. execution order matters

The error occurs when the XSLT transformation is executed via XSLTServlet within the database, but once the same transformation is executed via the transform:transform() function in an XQuery script stored in the database, subsequent executions via XSLTServlet succeed without errors. See following steps:

  1. Execute via XSLTServlet: http://localhost:8080/exist/doc-test/test-XSLTServlet/ --> error
  2. Execute via transform:transform(): http://localhost:8080/exist/apps/doc-test/test-transform/ --> success
  3. Execute via XSLTServlet: http://localhost:8080/exist/doc-test/test-XSLTServlet/ --> success

Since this error doesn't occur in eXist-3.0.RC1 (nor in eXist-3.0.RC2, although that version is giving me troubles with local paths to doc() that I couldn't reproduce, unfortunately), I suspect that it might be related to the issues that have been addressed recently in #1221.

Context information

  • eXist-db version: 3.0 / acd0c14
  • Java: 1.8.0_112
  • Operating system: Windows 7
  • 64 bit
  • No custom changes
@adamretter adamretter added the bug issue confirmed as bug label Mar 21, 2017
@adamretter adamretter added this to the eXist-3.2.0 milestone Mar 21, 2017
@rvdb
Copy link
Contributor Author

rvdb commented Apr 6, 2017

I've finally had the chance to test, and can confirm this issue is fixed by @shabanovd's PR #1316. What are the prospects for merging it into trunk? Even if it won't make it into the next eXist release, being able to update my webapps to the latest eXist development code would be a great temporary solution in the mean time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants