xsl-list
[Top] [All Lists]

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

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

Michael,

To what value should I set the system ID?

The document('') resolution still fails if I set the SystemId to the
directory of the stylesheet in the initial invocation:

      TransformerFactory transformerFactory =
TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl",
Thread.currentThread().getContextClassLoader());
      //TransformerFactory transformerFactory =
TransformerFactory.newInstance();

      URIResolver uriResolver = new ServletContextURIResolver(context);
      transformerFactory.setURIResolver(uriResolver);

      InputStream xslInputStream =
context.getResourceAsStream("/data/GetMonthLengths.xsl");
      Source xslSource = new StreamSource(xslInputStream);
      String realPath = context.getRealPath("/data");
      xslSource.setSystemId(realPath);

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




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