getAssociatedStyleSheet is not using the "correct" base path
for an XSLT
file referenced by a stylesheet PI in a web application hosted by Tomcat
I've got an XML file which has a stylesheet PI naming a .xsl file in the
The base path for tomcat is say /usr/local/tomcat and that for the
- <?xml-stylesheet type="text/xsl"
is /usr/local/tomcat/webapps/agenda. URI's starting with /agenda are
to a web application. The web application maps .xml file requests to a
getAssociatedStyleSheet knows nothing about the web app base path
- - Get's the request URI: /agenda.xml
- - Translates that to the "real" file name:
- - Calls TransformerFactory.getAssociatedStyleSheet to get the
different from the servlet engine base path, and translates the URI
relative to the engine base path yielding /usr/local/tomcat/agenda.xsl.
The URI should be mapped relative to the web app base path to
So, what is the right way to do this? I can't imagine that there's a base
as that wouldn't work with multiple web applications. I wish the Trax api
like getAssociatedStyleSheetURI that returned the URI rather than the
Source. Then, the
servlet could map it to the right directory.
Is there something in the Trax API that I missed for doing this? Any