469,097 Members | 1,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,097 developers. It's quick & easy.

XSLT applet.

I have been fighting a problem with writing an XSLT applet for several
days now.

The following code works in a command line application, and in the
applet viewer for provided with IBM eclipse. It fails in any browser,
and in the Java SDK's applet viewer.

The line marked below has an uncaught exception that shows the following
text:

Usually code that works in an application and fails in an applet is the
result of a classpath problem. I am using xalan and xerces in this
case, both of which are in the classpath.

Any suggestions regarding the origins of this problem are welcome.

Thank you,

Ben Jones

----------------------------------------------------------------------
java.lang.ExceptionInInitializerError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at org.apache.xalan.serialize.SerializerFactory.getSe rializer(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at
com.integretechpub.mathmltools.EquationTransformer .appletEquationForm(EquationTransformer.java:109)

at
com.integretechpub.mathmltools.EquationTransformer .init(EquationTransformer.java:334)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.RuntimeException: The resource [ XMLEntities.res ]
could not load: java.net.MalformedURLException: no protocol:
XMLEntities.res
XMLEntities.res java.net.MalformedURLException: no protocol:
XMLEntities.res

at org.apache.xalan.serialize.CharInfo.<init>(Unknown Source)

at org.apache.xalan.serialize.SerializerToXML.<clinit >(Unknown Source)

... 11 more

java.lang.ExceptionInInitializerError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at org.apache.xalan.serialize.SerializerFactory.getSe rializer(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at
com.integretechpub.mathmltools.EquationTransformer .appletEquationForm(EquationTransformer.java:109)

at
com.integretechpub.mathmltools.EquationTransformer .init(EquationTransformer.java:334)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.RuntimeException: The resource [ XMLEntities.res ]
could not load: java.net.MalformedURLException: no protocol:
XMLEntities.res
XMLEntities.res java.net.MalformedURLException: no protocol:
XMLEntities.res

at org.apache.xalan.serialize.CharInfo.<init>(Unknown Source)

at org.apache.xalan.serialize.SerializerToXML.<clinit >(Unknown Source)

... 11 more
----------------------------------------------------------------------

public String appletEquationForm(){
String eqnForm=new String();
eqnForm="thangs";
String xsl=this.getXSLTransform();
String xml=this.mathMLInput;
Source xmlSource=new StreamSource(new StringReader(xml));
Source xslSource=new StreamSource(new StringReader(xsl));
StringWriter eqnWriter=new StringWriter(4096);
StreamResult eqnResult=new StreamResult(eqnWriter);
Result eqnTestResult=new StreamResult(System.out);
javax.xml.transform.TransformerFactory transFact=
javax.xml.transform.TransformerFactory.newInstance ();
StringWriter osw = new StringWriter();
PrintWriter pw = new PrintWriter(osw, false);
try{
javax.xml.transform.Transformer
trans=transFact.newTransformer(xslSource);
//
//-----------------------------------------------------------------------------------------------------
// THIS IS THE LINE THE BLOWS AN UNCAUGHT EXCEPTION
//-------------------------------------------------------------------------------------------------------
trans.transform(xmlSource,new StreamResult(pw));
//StringBuffer sb=eqnWriter.getBuffer();
//eqnForm=sb.toString();
}
catch(TransformerConfigurationException e){
System.out.println("Caught Exception "+e);
e.printStackTrace();
return("<math><matherr/><text>Configuration Exception</text></math>");
}
catch(TransformerException f){
System.out.println("Caught Exception "+f);
f.printStackTrace(System.out);
return("<math><matherr/><text>Configuration Exception</text></math>");
}
return(eqnForm);
}

Jul 20 '05 #1
0 2870

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by nathanlaan | last post: by
reply views Thread by James Hong | last post: by
1 post views Thread by Charlie Kim | last post: by
5 posts views Thread by Gerald Aichholzer | last post: by
1 post views Thread by Tormod Omholt-Jensen | last post: by
reply views Thread by ankur | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.