It's not a secret anymore!
The moose likes JSP and the fly likes XSLTProcessor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "XSLTProcessor" Watch "XSLTProcessor" New topic


Krysty Sullivan
Ranch Hand

Joined: Jun 06, 2002
Posts: 48
I need to make use of XSLTProcessor (org.apache.xalan.xslt package) in my jsp page. The problem is even after I have already included the jar files (from that i downloaded in in the jre/lib/ext dir of the jdk i'm using, when I run the jsp page, the ff errors occur:
Type XSLTProcessor was not found.
C:\\Program Files\\Allaire\\JRun\\servers\\default\\default-app\\AdminTool\\transformXML2.jsp:44: Error: "XSLTProcessorFactory" is either a misplaced package name or a non-existent entity.
C:\\Program Files\\Allaire\\JRun\\servers\\default\\default-app\\AdminTool\\transformXML2.jsp:53: Error: Type XSLTInputSource was not found.
C:\\Program Files\\Allaire\\JRun\\servers\\default\\default-app\\AdminTool\\transformXML2.jsp:57: Error: Type XSLTResultTarget was not found.
//my code
<%@ page import="org.w3c.dom.*" %>
<%@ page import="org.xml.sax.*" %>
<%@ page import="javax.xml.parsers.*" %>
<%@ page import="javax.xml.transform.*" %>
<%@ page import="*" %>
<%@ page import="javax.xml.transform.dom.*" %>
<%@ page import="*" %>
<%@ page import="java.util.*" %>
<%@ page import="*" %>
<%@ page import="java.text.*" %>
<%@ page import="org.apache.xalan.xslt.*" %>
try {
XSLTProcessor p = XSLTProcessorFactory.getProcessor();

StringBuffer requestURL = HttpUtils.getRequestURL(request);
URL jspURL = new URL(requestURL.toString());
URL in1URL = new URL(jspURL,"master.xml");
URL in2URL = new URL(jspURL,"images.xml");
URL in3URL = new URL(jspURL,"labels.xml");
URL xslURL = new URL(jspURL,"page1.xsl");
p.process(new XSLTInputSource(in1URL.openStream{}),
new XSLTInputSource(in2URL.openStream{}),
new XSLTInputSource(in3URL.openStream{}),
new XSLTInputSource(xslURL.openStream{}),
new XSLTResultTarget(out)
catch (Exception ex) {
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
I can't see the XSLTProcessorFactory under this new JavaDoc
Krysty Sullivan
Ranch Hand

Joined: Jun 06, 2002
Posts: 48
Hi erin! You mean you can't see the XSLTProcessorFactory class in org.apache.xalan.xslt package? But whenever i search for XSLTProcessorFactory class in, it brings me to the documentation of
org.apache.xalan.xslt package where XSLTProcessorFactory is included as its class. I double-checked the org.apache.xalan.xslt package I downloaded at and found out that there was no XSLTProcessorFactory class found in the zip file. What do you suggest I should do?
I agree. Here's the link:
subject: XSLTProcessor
jQuery in Action, 3rd edition