posted 15 years ago
Hi All,
I came across the following minor stumbling block when trying to instantiate Saxon directly as opposed to searching through CLASSPATH recommended by yourself earlier:
( i ) Replaced [b]import javax.xml.transform.* [/b]with [b]net.sf.saxon.TransformerFactoryImpl[/b].
( ii ) Replaced [b]TransformerFactory stateFactory = TransformerFactory.newInstance() [/b]with
[b]net.sf.saxon.TransformerFactoryImpl hobbiesTransformer = new net.sf.saxon.TransformerFactoryImpl()[/b].
FileInputStream hobbiesStyleSheetIS = new FileInputStream(hobbiesStyleSheet);
BufferedInputStream hobbiesStyleSheetBIS = new BufferedInputStream(hobbiesStyleSheetIS);
( iii ) Replaced [b]Transformer hobbiesTransformer = hobbiesFactory.newTransformer(new StreamSource(hobbiesStyleSheetBIS)) [/b]with
[b]hobbiesTransformer.newTransformer(new StreamSource(hobbiesStyleSheetBIS))[/b].
// Run the transformation
JDOMSource hobbiesSource = new JDOMSource(hobbiesOriginaljdomDocument);
JDOMResult hobbiesResult = new JDOMResult();
// Run the transformation
System.err.println(hobbiesTransformer.getClass());
( iv ) Would like to replace [b]hobbiesTransformer.transform(hobbiesSource, hobbiesResult) [/b]with
[b]stateTransformer.? [/b]but couldn't find a match.
In other word, I couldn't find an equivalent statement in Saxon91 to do the transformation in step ( iv ) to swap out the default Java Xalan code.
This question has been posted at [url]http://forums.sun.com/thread.jspa?threadID=5368195 [/url]& other XML related sites without constructive response.
Thanks a lot for your help,
Jack