Bug 28278

Summary: order of attributes should not be important for x:transform
Product: Taglibs Reporter: Mirek Hankus <M.Hankus>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Mirek Hankus 2004-04-08 11:02:04 UTC
When defining stylesheet, location of version attribute is important, but it
should not be that way.

Steps to reproduce:
1. Install standard-examples.war in tomcat (5.0.22 in my case, on 5.0.19 same
situation)
2. Check if xml/Transform.jsp works (it should work)
3. Edit xml/Tranform so that attribute version of xsl:stylesheet is first
attribute of xsl:stylesheet, so that:
  <c:set var="xsl">
  <?xml version="1.0"?>
  <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

becomes

  <c:set var="xsl">
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

notice location of version attribute.

4. Try to see results. 


On my system I got exception:

javax.servlet.ServletException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException: java.lang.IllegalStateException: can't
declare any more prefixes in this context
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:819)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:755)
	org.apache.jsp.xml.Transform_jsp._jspService(Transform_jsp.java:135)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:268)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:277)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:223)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
Comment 1 Felipe Leme 2004-05-12 00:26:53 UTC
CC'ing the taglibs-dev address to all Standard bugs. 
Comment 2 Henri Yandell 2007-01-03 16:03:25 UTC
I can't repeat the bug under Tomcat 5.5 and JDK 1.5. While I know they're not
the real target for the Standard taglib I think it shows that the problem is
outside of the Standard taglib - either the Tomcat version or much, much more
likely the XML parser in the JVM.