I want to transform TaminoResult using XSL into HTML.
My code look like the following (it is a jsp running on Tomcat):
TransformerFactory tfactory = TransformerFactory.newInstance();
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
dfactory.setNamespaceAware(true);
DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
File xslFile = new File(getServletContext().getRealPath(“/”) + “test.xsl”);
Document xslDoc = docBuilder.parse(xslFile);
DOMSource xslSource = new DOMSource(xslDoc);
xslSource.setSystemId(xslFile.toString());
Templates templates = tfactory.newTemplates(xslSource);
Transformer transformer = templates.newTransformer();
// Get xml from tamino
TaminoClient tamino = new TaminoClient(taminourl);
tamino.setPageSize(0);
tamino.startSession();
TaminoResult tr = tamino.query(“Project”);
if (tr != null){
if (tr.hasMoreElements()) {
Document result = tr.getDocument();
DOMSource xmlSource = new DOMSource(result);
transformer.transform(xmlSource, new StreamResult(out));
} else {
out.println(“No Project Available”);
}
tamino.endSession();
The code above give me the following error when the page is called:
Error: 500
Location: /gwms/ProcessReport.jsp
Internal Servlet Error:
javax.servlet.ServletException
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Root cause:
java.lang.AbstractMethodError
at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:231)
at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.(DOM2DTM.java:150)
at org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:185)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:585)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1037)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1015)
at _0002fProcessReport_0002ejspProcessReport_jsp_56._jspService(_0002fProcessReport_0002ejspProcessReport_jsp_56.java:194)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Can anybody help?
Thank you,
Antony
[This message was edited by Antony on 16 Aug 2001 at 06:54.]