grchiu 2003/06/26 14:33:22
Modified: java/src/org/apache/xalan/templates ElemIf.java
Log:
Minor change to firing of trace events from xsl:if.
xsl:for-each now fires one trace event plus one for every iteration.
xsl:if should fire one regardless of whether or not the expression
evaluates true or false. Related to discussion on bug 11414.
Revision Changes Path
1.15 +10 -14 xml-xalan/java/src/org/apache/xalan/templates/ElemIf.java
Index: ElemIf.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemIf.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ElemIf.java 30 Jan 2003 18:45:50 -0000 1.14
+++ ElemIf.java 26 Jun 2003 21:33:22 -0000 1.15
@@ -174,24 +174,20 @@
if (TransformerImpl.S_DEBUG)
transformer.getTraceManager().fireSelectedEvent(sourceNode, this,
"test", m_test, test);
+
+ // xsl:for-each now fires one trace event + one for every
+ // iteration; changing xsl:if to fire one regardless of true/false
+
+ if (TransformerImpl.S_DEBUG)
+ transformer.getTraceManager().fireTraceEvent(this);
if (test.bool())
{
- // Note that there was a bad incompatibility with xsl:if...
- // which was called whether the test was successful or not.
- // With the current logic of xsl:for-each,
- // if the node-set is empty trace will not be called at all.
- // So I've changed xsl:if to match the xsl:for-each behavior.
- // -sb
-
- if (TransformerImpl.S_DEBUG)
- transformer.getTraceManager().fireTraceEvent(this);
-
- transformer.executeChildTemplates(this, true);
-
- if (TransformerImpl.S_DEBUG)
- transformer.getTraceManager().fireTraceEndEvent(this);
+ transformer.executeChildTemplates(this, true);
}
+
+ if (TransformerImpl.S_DEBUG)
+ transformer.getTraceManager().fireTraceEndEvent(this);
// I don't think we want this. -sb
// if (TransformerImpl.S_DEBUG)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]