wood burning stoves 2.0*
The moose likes JSP and the fly likes Encountered an unknown type while processing 'xslt' attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Encountered an unknown type while processing Watch "Encountered an unknown type while processing New topic
Forums: JSP XML and Related Technologies
Author

Encountered an unknown type while processing 'xslt' attribute

L Chan
Greenhorn

Joined: Apr 29, 2004
Posts: 6
Hi,

I'm just trying to transform an XML document using the XML tags in JSTL 1.1. I'm using Tomcat 5.5.7 as my web container and JRE 1.5. Here's my jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>

<c:import var="zzzz-Instance" url="forms/zzzz-Instance.xml" />
<c:import var="zzzz-XHTML" url="forms/zzzz-XHTML.xml" />
<c:import var="zzzz-XSL" url="xslt/zzzz-jsp.xsl" />

<x:transform var="zzzz-Full" doc="${zzzz-XHTML}" xslt="${zzzz-XSL}" />

<x ut select="$zzzz-Full/*" />

When I access this jsp, I get the following error on Tomcat:

javax.servlet.ServletException: <transform> encountered an unknown type while processing 'xslt' attribute
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl .java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.j ava:779)
org.apache.jsp.WEB_002dINF.ConfigurationEditor_jsp._jspService(org.apache.jsp.W EB_002dINF.ConfigurationEditor_jsp:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
....

We've used the other JSTL 1.1 tags (i.e. functions, fmt, etc.) with no problems, so I don't think this is a setup problem. The XML and XSL files are well formed XML files... So what's going on here?

Thanks.
Eric Borisow
Greenhorn

Joined: Mar 16, 2006
Posts: 2
I see that this one was asked a while ago, but I ran into the same problem recently. So, just to help others, I found that the problem for me was the name of the variable that I was storing the xslt result in was bad. It contained a '-' which was not a problem for jstl, in general, but the xml jstl tag library doesn't like it.

So, you would have to change:

to:


Regards,
Eric
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Thanks for the follow-up, Eric. In this case I would say "better late than never" definitely applies!

(I'm linking this thread to the XML forum as well in case somebody decides to search there for this problem.)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Encountered an unknown type while processing 'xslt' attribute