I've still have had no luck here, even after digging around in the source
to see what is going on.

An example:

I'm transforming a Document in memory to directory1 using a stylesheet in
directory2 that imports a stylesheet also in directory2:

TransformerFactory factory = TransformerFactory.newInstance();

JDOMSource xmlsource = new JDOMSource(document);

// doesn't seem to matter what I put here:
xmlsource.setSystemId("file:///directory1/report.xml")
StreamSource xslsource = new StreamSource("/directory2/template.xsl");
xslsource.setSystemId("file:///directory2/template.xsl");

// failure at the next line, no exception or error to stderr or stdout
Transformer trans = factory.newTransformer(xslsource);

trans.transform(xmlsource, new StreamResult("/directory1/report.html");

Again, the equivilant works fine from the command line:

cd directory2 ; java org.apache.xalan.xslt.Process -in
/directory1/report.xml -out /directory1/report.html -xsl template.xsl


Reply via email to