Bug 7848 - <x:param> causes TransformerConfigurationException
Summary: <x:param> causes TransformerConfigurationException
Status: RESOLVED INVALID
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0B1
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-08 19:05 UTC by Xiaotan(Helen) He
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaotan(Helen) He 2002-04-08 19:05:10 UTC
Here is the way I pass the parameter in the JSP file:

 <c:import url="test.xsl" var="xsl"/>
 <x:transform xmlText="${xml}" xsltText="${xsl}">
 <x:param name="cls" value="newstyle"/>
  </x:transform>

Here is what I put in the test.xsl file:

<table border="1" class="{$cls}">

 However, in the browser, it throws the following exceptions:

  javax.servlet.jsp.JspTagException:
  javax.xml.transform.TransformerConfigurationException:
  javax.xml.transform.TransformerConfigurationException:
  javax.xml.transform.TransformerException:
  org.apache.xml.utils.WrappedRuntimeException: Could not find variable with the 
name of cls
Comment 1 Shawn Bayern 2002-04-08 19:22:20 UTC
Hi Helen.

Sorry, I meant to get back to you personally on this over the weekend.  I took 
a look at the XSLT file sent, and the problem is actually with the stylesheet.  
In XSLT, you need to declare a parameter before using it.  That is, if your 
stylesheet began like this, the problem should go away:

  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  version="1.0">
  <xsl:param name="cls" select="default" />
  <xsl:template match="/">

  <table border="1" class="{$cls}">

The <xsl:param> element is the important one; it declares a parameter and 
specifies a default binding (which is used if no <x:param> tag defines a value 
for the name).  If you'd like more information, feel free to ask me, or read 
Section 11 of the XSLT spec (http://www.w3.org/TR/xslt#variables).

Hope that helps,

Shawn