Hello,

We have saxon9ee.jar evaluation version and we are planing to buy it in few weeks... but we are still in Proof of concept mode.

Working Code:

URL url = Thread.currentThread().getContextClassLoader().getResource("templates/Pt2Stylesheet.xsl");

String absoluteFilePath = url.getPath();


Source xsl = new StreamSource(absoluteFilePath );
TransformerFactory factory = TransformerFactory.newInstance();
SAXTransformerFactory saxTransFact = (SAXTransformerFactory) factory;
saxTransFact.newTemplates(xsl);             
Transformer transformer = saxTransFact.newTransformer(xsl);

Note: Above code doesn't work when we ship code in jar file.

for that we make following changes

InputStreem xslInputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream ("templates/Pt2Stylesheet.xsl");

Source xsl = new StreamSource(xslInputStream );

Note: I Also tried to set systemId.


After making changes in the above code it stop working and throwing some exception parser exception....


Please suggest how can we overcome from this problem....


Thanks!

Bhagat