Hi all,
        I'm having a problem passing params to using the Xtags taglib.
The example shows:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0"; prefix="xtags"
%>
<%-- 
    Demos the use of the <xtags:style> tag 
    using relative URIs and parameters are passed into the stylesheet
--%>
<xtags:style xml="test2.xml" xsl="sample.xsl" outputMethod="html">
  <xtags:param name="name" value="James"/>
  <xtags:param name="time"><%= new
java.util.Date().toString()%></xtags:param>
</xtags:style>
</html>

However, even that does not run correct. The error shows:

A Servlet Exception Has Occurred
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 9 in the jsp file: /style/styledemo5.jsp

Generated servlet error:
C:\JBoss-2.4.3_Tomcat-4.0\catalina\work\localhost\xtags-examples\style\style
demo5$jsp.java:94: Undefined variable: James
                              _jspx_th_xtags_param_0.setValue(new
String(James));
                                                                         ^
1 error

        at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
        at org.apache.jasper.servlet.JspServlet.loadJSP(Unknown Source)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Unkno
wn Source)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Unknown
Source)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown
Source)
        at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
Source)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown
Source)
        at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContextValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.valves.CertificatesValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardEngineValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.connector.http.HttpProcessor.process(Unknown
Source)
        at org.apache.catalina.connector.http.HttpProcessor.run(Unknown
Source)
        at java.lang.Thread.run(Unknown Source)

The second method works correctly but I cannot seem to use that param in a
xsl:if

the syntax that I use is:

  <xtags:param name="valid"><%= new Boolean("true") %></xtags:param>

  and inside the xsl
  <xsl:param name="valid"/>

  <xsl:if test="$valid='true'">

  I have tried variations on this as well
  <xsl:if test="$valid=true">
  <xsl:if test="$valid">

  And those combinations with:
  <xtags:param name="valid"><%= true %></xtags:param>

None of which works.

One thing to note is that I removed Cocoon because I am using Xerces.

-Tim

-------------------------------------
Gin-Ting Chen
[EMAIL PROTECTED]
727-738-3000 x6549
Sun Certified Programmer
Sun Certified Web Component Developer
BEA Certified Developer

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

Reply via email to