xsl-list
[Top] [All Lists]

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

2010-01-06 19:35:54
From: Roger L. Cauvin [mailto:roger(_at_)cauvin(_dot_)org]
Sent: Wednesday, January 06, 2010 08:29 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] RE: URI Resolution for document('') Reference Is Broken?

Andrew Houghton wrote:

setSystemId value needs to be a file: URI not a file
system path.

Tried that, too, and it didn't work:

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.


--~------------------------------------------------------------------
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>
--~--