PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2835 *** shadow/2835 Thu Jul 26 08:28:48 2001 --- shadow/2835.tmp.17120 Thu Jul 26 08:28:48 2001 *************** *** 0 **** --- 1,82 ---- + +============================================================================+ + | Redirecting problems with variables and parameters | + +----------------------------------------------------------------------------+ + | Bug #: 2835 Product: XalanJ2 | + | Status: NEW Version: 2.2.x | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Linux | + | Priority: Other Component: org.apache.xalan.lib.Re | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + I have a parameterized stylesheet. This parameter gives the filename, where to + redirect:write (incl. path): + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:redirect="org.apache.xalan.lib.Redirect" + extension-element-prefixes="redirect"> + <xsl:param name="stillincomplete-path"/> + + ... + + <xsl:template match="entry"> + <xsl:if test="$stillincomplete-path"> + <redirect:write select="$stillincomplete-path"> + ... + </redirect:write> + </xsl:if> + </xsl:template> + + ... + + </xsl:stylesheet> + + But if there is no param/variable in this template, where I want to + redirect:write, it won't work: + + javax.xml.transform.TransformerException + at + org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1151) + at + org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:590) + at + org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1037) + at + org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1015) + at + org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:96) + at + org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:310) + at + org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:173) + at org.apache.tools.ant.Target.execute(Target.java:150) + at org.apache.tools.ant.Project.runTarget(Project.java:820) + at org.apache.tools.ant.Project.executeTarget(Project.java:534) + at org.apache.tools.ant.Project.executeTargets(Project.java:508) + at org.apache.tools.ant.Main.runBuild(Main.java:425) + at org.apache.tools.ant.Main.main(Main.java:149) + + And if I have a param/variable in this stylesheet the value of this one is used + and not the value of $stillincomplete-path. + + I got an easy workaround: + + <xsl:template match="entry"> + <xsl:param name="stillincomplete-tmp" select="$stillincomplete-path"/> + <xsl:if test="$stillincomplete-path"> + <redirect:write select="$stillincomplete-path"> + ... + </redirect:write> + </xsl:if> + </xsl:template> + + So the value of $stillincomplete-tmp is used, which is my wished value of + $stillincomplete-path. + + If you need more information, mail me. + + Regards, Joerg Heinicke
