Problem with URL resolution in XSLT stylesheets

23 views
Skip to first unread message

mats....@yahoo.com

unread,
May 27, 2017, 3:51:04 AM5/27/17
to membrane-monitor
Hi

I'm having some problems with the <transform/> interceptor.

I'm using it like this: <transform xslt="mystylesheet.xsl"/>. The stylesheet is located in the same folder as the proxies.xml.

The stylesheet contains the following element <xsl:import href="imported.xsl"/>.

Exception is thrown indicating that the location of the imported.xsl is not properly resolved.

In the source code of XSLTTransformer.java I find:

StreamSource source = new StreamSource(rr.resolve(ResolverMap.combine(baseLocation, styleSheet)));
source.setSystemId(styleSheet);

Will this work for situations where styleSheet is a relative path?


mats....@yahoo.com

unread,
May 28, 2017, 1:23:19 AM5/28/17
to membrane-monitor
I moved the stylesheet into the classpath (in my webapp from WEB-INF into WEB-INF/classes) and then replaced the relative path with "classpath:/mystylesheet.xsl", and then resolution of referenced imported stylesheets worked.

Tobias Polley

unread,
May 28, 2017, 3:13:45 AM5/28/17
to membrane-monitor
Hi Mats,


On Sunday, May 28, 2017 at 7:23:19 AM UTC+2, mats....@yahoo.com wrote:
I moved the stylesheet into the classpath (in my webapp from WEB-INF into WEB-INF/classes) and then replaced the relative path with "classpath:/mystylesheet.xsl", and then resolution of referenced imported stylesheets worked.

OK, thanks for the description of the workaround.

Usually, using relative paths in any document (proxies.xml or stylesheet) should resolve relatively to where this document was loaded from. If this does not work for proxies.xml (referencing "./a.xslt") and a.xslt (referencing "./b.xslt") with all files put into the "conf" directory, I would say, it's a bug.

Best
Tobias
Reply all
Reply to author
Forward
0 new messages