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

Subject: RE: [xsl] RE: URI Resolution for document('') Reference Is Broken?
From: "Houghton,Andrew" <houghtoa@xxxxxxxx>
Date: Wed, 6 Jan 2010 19:21:22 -0500
> From: Roger L. Cauvin [mailto:roger@xxxxxxxxxx]
> Sent: Wednesday, January 06, 2010 07:08 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> 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.

Current Thread