jsp page with XML and XSLT

hi,
  I'm following this tutorial to get XML and XSLT files to work with JSP page and followed all the instructions correctly and rechecked them. However when I try to view the JSP page I get this error.

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.taglibs.xsl.ImportTei
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause
BrijBhasinAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jpolin1Connect With a Mentor Commented:
Looks like maybe its compaining about the location of book.xsl.
Make sure that is in the right spot, and maybe play around with the path, like "xml/book.xsl"
or put a Fully qualified path to the xsl .
0
 
jpolin1Commented:
Do you have the TLD and jar files for that tag library in the right spot?
0
 
BrijBhasinAuthor Commented:
I copied the tag-lib jar in the lib folder
http://www.webreference.com/xml/column37/2.html

Now, I'm getting this error.  
org.apache.jasper.JasperException: /book.jsp(5,0) No tag "InsertWithXSL" defined in tag library imported with prefix "xsl"
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jpolin1Commented:
Did you put xsl.tld in the WEB-INF directory?
0
 
BrijBhasinAuthor Commented:
yes I do
0
 
jpolin1Commented:
Could you paste the jsp in question up here? book.jsp ? Thanks
0
 
BrijBhasinAuthor Commented:
<%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl"%>
<html>
<head><title>Phone Book</title></head>
<body>
<xsl:InsertWithXSL xml="/xml/book.xml" xsl="/xml/book.xsl" />
</body>
</html>
0
 
jpolin1Commented:
I think the InsertWithXSL tag has been removed from that library.
Look in your TLD file for insertWithXSL, if its not there then the version of the tag library you downloaded doesn't contain that tag anymore.

Try replacing it with the apply tag, like below:

<%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl"%>
<html>
<head><title>Phone Book</title></head>
<body>
<xsl:apply xml="/xml/book.xml" xsl="/xml/book.xsl" />
</body>
</html>
0
 
BrijBhasinAuthor Commented:
I changed it to apply - <xsl:apply xml="/xml/book.xml" xsl="/xml/book.xsl" />
and now I get this error
javax.servlet.ServletException: org/apache/xalan/xslt/XSLTInputSource
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
0
 
BrijBhasinAuthor Commented:
I have tried all combinations and even moved all my files in the same directory but still getting this error .. any more ideas..thanks.
0
 
BrijBhasinAuthor Commented:
This works.  ..
<%@ taglib uri="http://java.sun.com/jstl/xml"  prefix="x" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<html >
  <head>
    <title>XSLT Test</title>
  </head>

  <body>
    <c:import url="F.xml" var="inputDoc" />
    <c:import url="F.xsl" var="stylesheet" />

    <x:transform xml  = "${inputDoc}" xslt = "${stylesheet}">
    </x:transform>
  </body>


</html>
Also make sure that the xsl and xml are created in the same editor... my xml wasn't being transformed initially by this because of this weird reason.
0
 
jpolin1Commented:
glad to here its working
0
 
BrijBhasinAuthor Commented:
Thanks for all your help jpolin1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.