You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/05/03 12:50:11 UTC

[Bug 1611] New - Global variables not re-evaluated on re-use of a Transformer

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1611

*** shadow/1611	Thu May  3 03:50:11 2001
--- shadow/1611.tmp.16003	Thu May  3 03:50:11 2001
***************
*** 0 ****
--- 1,38 ----
+ +============================================================================+
+ | Global variables not re-evaluated on re-use of a Transformer               |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1611                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.1                   |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority:                           Component: org.apache.xalan.transf |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xalan-dev@xml.apache.org                                     |
+ |  Reported By: paul.wilson@one-ten.com                                      |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ When re-using a transformer, java.xml.transform.Transformer (org.apache.xalan.transformer.TransformerImpl), global (stylesheet level) variables are not re-evaluated: the value assigned during the first transformation is re-used.  This may be worked around by calling Transformer::clearParameters() before the next transform.
+ 
+ I suspect that this may be related to bug 1534.
+ 
+ The variable "importId" in the stylesheet pasted below, is such a variable.
+ 
+ <xsl:stylesheet version = "1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ 
+ 
+ 
+ <xsl:variable name = "importId" select = "/ImportMessage/@ArchiveImportId"/>
+ 
+ 
+ <xsl:template match = "ImportMessage">
+ 
+     <!-- Message node -->
+     <Record TableName = "swift15022node" IdFieldName = "id">
+        <Field ColumnName = "importid" IsQuoted = "false"><xsl:value-of select = "$importId "/></Field>
+     </Record>
+ </xsl:template>
+ 
+ </xsl:stylesheet>