This worked fine for me. It produced:

<html>
    <head>
        <title>petxtransform1.jsp JSTL x:transform example</title>
    </head>
    <body>

        <p>Transformation going directly to the output:<br />
            Hello, world!
        
        </p>
    </body>
</html>

Note that I changed the taglib directives to:

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

And I have Xerces 2.6.2 and Xalan 2.6.0 installed in
$CATALINA_HOME/common/endorsed. As for standard-examples, the only XML example
that failed was "Transform with inclusion". However, it was a different error
than what you observed. I'm playing a bit more with that now to see what's
up...

Quoting Peter Norris <[EMAIL PROTECTED]>:

> Having problems with x:transform on the following platform:
> WinXP
> JDK 1.4.2_05
> Tomcat 5.0.28
> JSTL 1.1.1
> 
> This code worked previously on:
> WinXP
> JDK 1.4.1_03
> Tomcat 4.1.27
> JSTL 1.0.3
> 
> The JSTL standard-examples.war produces a similar stack trace as do 
> other previously working transforms using external files and readers. 
> Details of what Tomcat reports through the command window, stack trace 
> and source code are below. Has anyone any suggestions?
> 
> Peter Norris
> De Montfort University
> UK
> 
> ########## Tomcat command window report ###################
> 
> XSL-1108: (Error) Invalid Source - URL format is incorrect.
> 
> XSL-1000: (Fatal Error) Error while parsing XSL file (null).
> 
> ########## stack trace ######################################
> 
> javax.servlet.ServletException: javax.servlet.jsp.JspException: XSL-1000:
> (Fatal Error) Error while parsing XSL file (null).
>
        
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
>
        
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
>
        
org.apache.jsp.petshow.jsp.jstl.petxtransform1_jsp._jspService(petxtransform1_jsp.java:90)
>       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
>       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
> root cause
> 
> javax.xml.transform.TransformerConfigurationException: XSL-1000: (Fatal
> Error) Error while parsing XSL file (null).
>
        
oracle.xml.jaxp.JXSAXTransformerFactory.reportConfigException(JXSAXTransformerFactory.java:676)
>
        
oracle.xml.jaxp.JXSAXTransformerFactory.newTemplates(JXSAXTransformerFactory.java:331)
>
        
oracle.xml.jaxp.JXSAXTransformerFactory.newTransformer(JXSAXTransformerFactory.java:246)
>
        
org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag(TransformSupport.java:165)
>
        
org.apache.taglibs.standard.tag.el.xml.TransformTag.doStartTag(TransformTag.java:104)
>
        
org.apache.jsp.petshow.jsp.jstl.petxtransform1_jsp._jspx_meth_x_transform_0(petxtransform1_jsp.java:181)
>
        
org.apache.jsp.petshow.jsp.jstl.petxtransform1_jsp._jspService(petxtransform1_jsp.java:79)
>       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
>       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
>       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
> 
> 
> ########## source code  ####################
> <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml"; %>
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
> 
> <c:set var="myXml">
>     <greeting>Hello</greeting>
> </c:set>
> 
> <c:set var="myXslt">
>     <?xml version="1.0"?>
>     <xsl:stylesheet version="1.0"
>         xmlns:xsl= "http://www.w3.org/1999/XSL/Transform";>
>         
>         <xsl:output omit-xml-declaration="yes" />
>         
>         <xsl:template match="/">
>             <xsl:value-of select="greeting" />, world!
>         </xsl:template>
>             
>     </xsl:stylesheet>
> </c:set>
> 
> <html>
>     <head>
>         <title>petxtransform1.jsp JSTL x:transform example</title>
>     </head>
>     <body>
>         <p>Transformation going directly to the output:<br />
>             <x:transform xml="${myXml}" xslt="${myXslt}" />
>         </p>
>     </body>
> </html>
> ############## end source ######################

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to