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

[XsltView] URI base for imports is meaningless [SPR-4894] #9570

Closed
spring-projects-issues opened this issue Jun 5, 2008 · 1 comment
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Kenny MacLeod opened SPR-4894 and commented

I've been using XsltViewResolver for the first time, and found some rather peculiar behaviour when it comes to resolving the URI base for XSL imports.

Say I have a stylesheet defined in /WEB-INF/transform.xslt and that stylesheet contains <xsl:import href="import.xslt"/> where import.xslt is contained in the same WEB-INF directory. The import fails because import.xslt cannot be found.

If I then plug in my own URIResolver and make it log the href and base arguments, the base has actually resolved as file:///D:/WEB-INF. I'd expect the base to be the webapp's WEB-INF directory on disk. This is probably because when Spring wraps my transform.xslt in a StreamSource (via ServletContextResource) and passes that Source to the TransformerFactory, it loses all context information and doesn't know the base URi of the stylesheet.

Would it be possible for XsltViewResolver to default to a sensible implementation of URIResolver, which uses the local ResourceLoader to try and locate the resource? The current behaviour would seem to be completely useless.


Affects: 2.0.8, 2.5.4, 2.5.5

Backported to: 2.0.9

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Thanks for pointing this out! We accidentally only specified the resource location part as XSLT system id there, not the full URI... I've fixed this for Spring 2.5.6.

This will be available in tonight's 2.5.6 snapshot (http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR). Please give it a try and let me know whether it works for you now...

Juergen

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 2.5.6 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants