xsl-list
[Top] [All Lists]

[xsl] RE: URI Resolution for document('') Reference Is Broken?

2010-01-06 20:26:25
Andrew Houghton wrote:

This is what I did in a filter and it seems to work
fine.  Granted it's a filter rather than a servlet,
but it shouldn't matter.

 private ServletContext context;

 String       path = context.getRealPath(value);
 File         file = new File(path);
 StreamSource src  = new StreamSource(file);

 src.setSystemId(file.toURI().toURL().toString());
 log.info("transform location is " + path);
 log.info("transform SystemId is " + src.getSystemId());

 xf = tf.newTransformer(src);

Andy, what are you doing in your stylesheets?  My resolver works fine for
xsl:include calls and calls to document() in which the parameter is not the
empty string.  It fails when document('') is called from a stylesheet that
has been included by another stylesheet, however.

--
Roger L. Cauvin
@rcauvin (Twitter)
cauvin.blogspot.com (blog)



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--