[xsl] not() function behaving differently in java 1.4 and 1.5 environment.

Subject: [xsl] not() function behaving differently in java 1.4 and 1.5 environment.
From: "Tandon, Rohit" <Rohit.Tandon@xxxxxx>
Date: Thu, 2 Aug 2007 15:06:15 -0400
Hi,

We have recently upgraded our application from java 1.4 to java 1.5.
There is an XSL file for HTML conversion which is acting differently in
the java upgraded version.

On a dry run we found the value of variable ($value) is null.  The
matrix below explains different test scenarios in which we ran the test
changing java version and replacing not($value) with $value=''.

Java Version					Syntax Used
Test Result
------------------------------------------------------------------------
------------------------------------------
 1.4				<xsl:when test="not($value) and
position() = 1">YES</xsl:when>		   True
 1.4				<xsl:when test="$value = '' and
position() = 1">YES</xsl:when>	                      False
 1.5				<xsl:when test="not($value) and
position() = 1">YES</xsl:when>	            False
 1.5				<xsl:when test="$value  = '' and
position() = 1">YES</xsl:when>	            True

The first test case is what the xsl originally looked like. The same
test fails in java 1.5 environment. Interestingly changing the not()
function with operator = (see test# 4), the xsl works fine.

We have a couple of questions for this behavior:

*	Is the change in behavior due to upgrading the java environment
or we are missing something else?
*	Is there a difference in how a null and an empty string('') are
interpreted in java 1.4 and java 1.5?
*	Are the semantics of the statements we are using for not() and
the = operator equivalent?
*	Does XSL distinguish between null value and an empty string
('')?

Thanks in advance for all your help.

Regards
Rohit

Current Thread