RE: [xsl] Error when moving from Xalan to Saxon

Subject: RE: [xsl] Error when moving from Xalan to Saxon
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 3 Nov 2004 16:15:34 -0000
It looks as if you are trying to run Saxon under JDK 1.3, and it's failing
because the class java.lang.AssertionError isn't present in that
environment.

Saxon requires JDK 1.4.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Bhupendra Singh [mailto:skbhupendra@xxxxxxxxxxx] 
> Sent: 03 November 2004 14:50
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Error when moving from Xalan to Saxon
> 
> Hi,
> I dont know if this is the correct forum to put the
> quesiton, but maybe somebody can help me out.
> 
> I have a simple java class to transform a XML using a
> XSL to a HTML. Here is the java code.
> 
> ///////////////////
> import java.io.*;
> 
> import javax.xml.transform.Transformer;
> import
> javax.xml.transform.TransformerConfigurationException;
> import javax.xml.transform.TransformerException;
> import javax.xml.transform.TransformerFactory;
> import javax.xml.transform.stream.StreamResult;
> import javax.xml.transform.stream.StreamSource;
> 
> public class TransformerTest
> {
> 	public static void main(String[] args)
>     throws TransformerException,
> TransformerConfigurationException,
>            FileNotFoundException, IOException
>   {
> 	String strXSLFile = "ToHTML.XSL";
> 	String xmlFileName = "MyXML.xml";
> 
> 
> System.setProperty("javax.xml.transform.TransformerFactory","n
> et.sf.saxon.TransformerFactoryImpl");
> 	System.out.println("JRE HOME                  =
> "+System.getProperty("java.home"));
> 	System.out.println("JRE VERSION               =
> "+System.getProperty("java.version"));
> 
> 
> 	TransformerFactory tFactory =
> TransformerFactory.newInstance();
> 
> 	Transformer transformer = tFactory.newTransformer(new
> StreamSource(strXSLFile));
> 
> 	System.out.println("TransformerFactory  class =
> "+tFactory.getClass().getName());
> 	System.out.println("Transformer class         =
> "+transformer.getClass().getName());
> 
> 	transformer.transform(new StreamSource(xmlFileName),
> new StreamResult(new FileOutputStream("tpc.out")));
>   }
> }
> /////////////
> 
> I am running this java class in WSAD (IBM Websphere
> Studio Aplication Developer). I have the saxon8.jar in
> my classpath.
> I get the gollowing error while running it.
> /////////
> JRE HOME                  = C:\Program
> Files\IBM\WebSphere Studio\Application
> Developer\v5.1\runtimes\base_v5\java\jre
> JRE VERSION               = 1.3.1
> 
> java.lang.NoClassDefFoundError:
> java/lang/AssertionError
> 	at java.lang.Class.forName1(Native Method)
> 	at java.lang.Class.forName(Class.java:142)
> 	at
> net.sf.saxon.functions.ExtensionFunctionFactory.class$(Extensi
onFunctionFactory.java:16)
> 	at
> net.sf.saxon.functions.ExtensionFunctionFactory.<init>(Extensi
> onFunctionFactory.java:16)
> 	at
> net.sf.saxon.Configuration.<init>(Configuration.java:62)
> 	at
> net.sf.saxon.TransformerFactoryImpl.<init>(TransformerFactoryI
> mpl.java:48)
> 	at java.lang.Class.newInstance0(Native Method)
> 	at java.lang.Class.newInstance(Class.java:262)
> 	at
> javax.xml.transform.FactoryFinder.newInstance(Unknown
> Source)
> 	at javax.xml.transform.FactoryFinder.find(Unknown
> Source)
> 	at
> javax.xml.transform.TransformerFactory.newInstance(Unknown
> Source)
> 	at TransformerTest.main(TransformerTest.java:33)
> Exception in thread "main" 
> /////////
> 
> Has any body come acrosss this error. Any pointers
> will be highly appreciated.
> regards,
> Bhupendra.
> 
> 
> 	
> 	
> 		
> ___________________________________________________________ALL
> -NEW Yahoo! Messenger - all new features - even more fun! 
> http://uk.messenger.yahoo.com

Current Thread