R
Richard
Hello,
Do you have any idea of my problem? The undermentioned program does not
work with Java 1.5.0_05 but worked with Java 1.4. The problem is related
to XSLTC but perhaps my environment is the problem? (my system is
Windows XP).
Thanks in advance for your help.
Richard
import java.io.File;
import java.net.URL;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class Main {
public static void main(String[] args) throws Exception {
TransformerFactory tfactory = TransformerFactory.newInstance();
URL urlXSL = Main.class.getResource("zoo.xsl");
URL urlXML = Main.class.getResource("zoo.xml");
File fichierXSL = new File(urlXSL.toURI());
File fichierXML = new File(urlXML.toURI());
Templates templates =
tfactory.newTemplates(new StreamSource(fichierXSL));
Transformer transformer = templates.newTransformer();
// The following lines have no importance because
// the problem is at the previous line.
}
}
Error Message:
Exception in thread "main"
javax.xml.transform.TransformerConfigurationException:
Chargement impossible de la classe translet 'zoo'.
(Translation in english: Impossible to load the translet class 'zoo')
at
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.defineTransletClasses(Unknown
Source)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getTransletInstance(Unknown
Source)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.newTransformer(Unknown
Source)
at Main.main(Main.java:21)
Do you have any idea of my problem? The undermentioned program does not
work with Java 1.5.0_05 but worked with Java 1.4. The problem is related
to XSLTC but perhaps my environment is the problem? (my system is
Windows XP).
Thanks in advance for your help.
Richard
import java.io.File;
import java.net.URL;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class Main {
public static void main(String[] args) throws Exception {
TransformerFactory tfactory = TransformerFactory.newInstance();
URL urlXSL = Main.class.getResource("zoo.xsl");
URL urlXML = Main.class.getResource("zoo.xml");
File fichierXSL = new File(urlXSL.toURI());
File fichierXML = new File(urlXML.toURI());
Templates templates =
tfactory.newTemplates(new StreamSource(fichierXSL));
Transformer transformer = templates.newTransformer();
// The following lines have no importance because
// the problem is at the previous line.
}
}
Error Message:
Exception in thread "main"
javax.xml.transform.TransformerConfigurationException:
Chargement impossible de la classe translet 'zoo'.
(Translation in english: Impossible to load the translet class 'zoo')
at
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.defineTransletClasses(Unknown
Source)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getTransletInstance(Unknown
Source)
at
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.newTransformer(Unknown
Source)
at Main.main(Main.java:21)