This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "XSLTProcessor" Watch "XSLTProcessor" New topic
Author

XSLTProcessor

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 xalan-j_2_4_D1-bin.zip that i downloaded in xml.apache.org) 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="javax.xml.transform.stream.*" %>
<%@ page import="javax.xml.transform.dom.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.net.*" %>
<%@ 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)
);
out.flush();
}
catch (Exception ex) {
ex.printStackTrace();
}
%>
ersin eser
Ranch Hand

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

http://xml.apache.org/xalan-j/apidocs/index.html
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 google.com, 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 xml.apache.org 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: http://aspose.com/file-tools
 
subject: XSLTProcessor
 
Similar Threads
xalan
XSLProcessorException : usage of XSLTInputSource
JSP with XSL
JSP and XSL
Jsp Error