[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

not() function behaving differently in java 1.4 and 1

Subject: 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
  not() function behaving differently in java 1.4 and 1
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.