Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Encountered an unknown type while processing 'xslt' attribute

 
L Chan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21128
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic