Hi Michael,


You are right once again. I have followed your instruction to correct what was a simple mistakes for a novice programmer.


Much appreciated for your help.


Thank you so much,



From: Michael Kay <mike@saxonica.com>
To: Mailing list for the SAXON XSLT and XQuery processor <saxon-help@lists.sourceforge.net>
Sent: Saturday, 21 February, 2009 10:33:17 AM
Subject: Re: [saxon] XSLT 2.0 Saxon 91 Instantiation

You seem to have got into a muddle by naming your TransformerFactory hobbiesTransformer, a name which you previously used for your Transformer.
You should only need to change one line:
TransformerFactory stateFactory = TransformerFactory.newInstance();
TransformerFactory stateFactory = new net.sf.saxon.TransformerFactoryImpl();
Michael Kay

From: Jack Bush [mailto:netbeansfan@yahoo.com.au]
Sent: 18 February 2009 11:47
To: saxon-help@lists.sourceforge.net
Subject: [saxon] XSLT 2.0 Saxon 91 Instantiation

Hi All,


I came across the following minor stumbling block when trying to instantiate Saxon directly as opposed to searching through CLASSPATH:


( i ) Replaced import javax.xml.transform.* with net.sf.saxon.TransformerFactoryImpl.

( ii ) Replaced TransformerFactory stateFactory = TransformerFactory.newInstance() with

       net.sf.saxon.TransformerFactoryImpl hobbiesTransformer = new net.sf.saxon.TransformerFactoryImpl().

       FileInputStream hobbiesStyleSheetIS = new FileInputStream(hobbiesStyleSheet);

       BufferedInputStream hobbiesStyleSheetBIS = new BufferedInputStream(hobbiesStyleSheetIS);

( iii ) Replaced Transformer hobbiesTransformer = hobbiesFactory.newTransformer(new StreamSource(hobbiesStyleSheetBIS)) with

       hobbiesTransformer.newTransformer(new StreamSource(hobbiesStyleSheetBIS)).


       JDOMSource hobbiesSource = new JDOMSource(hobbiesOriginaljdomDocument);

       JDOMResult hobbiesResult = new JDOMResult();



( iv ) Would like to replace hobbiesTransformer.transform(hobbiesSource, hobbiesResult) with

stateTransformer.? 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.


Thanks a lot for your help,


Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more.

Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more.