Subject:Testing for empty string - something obvious not working Author:Neal Walters Date:03 May 2006 06:01 PM Originally Posted: 03 May 2006 05:39 PM
I think I'm going crazy here. I'm in a called template. I'm using debugger, and $updatedPhone is supposed blank and seems to be blank, and even shows a string-length of zero. However using F11 in the debugger, it passes right over a test of ($updatedPhone = ''). <br>
I don't understand why this is not true.
DEBUG $updatedPhone="<xsl:value-of select="string-length($updatedPhone)"/>"
<xsl:if test="$updatedPhone = ''">
<!-- this never gets executed -->
<xsl:value-of select="$typePhone"/> phn deleted
</xsl:if>
In my craziness - I put a not around the != and the test is now true.
<xsl:if test="not($updatedPhone != '')">
<xsl:value-of select="$typePhone"/> phn deleted
</xsl:if>
Can anyone shed some light on this?
Thanks again,
Neal Walters
http://Biztalk-Training.com
Subject:Testing for empty string - something obvious not working Author:Neal Walters Date:04 May 2006 06:55 PM Originally Posted: 04 May 2006 06:02 PM
I probably should have posted this under XSLT - it's related to the DeepDiff example you gave me - which is working great by the way. <br>
<br>
I'm getting problem with Net 1.0 processor (and built-in).
This is the test that's causing problem:
<xsl:if test="$updatedPhone = ''">
The value seems to be blank based on the debugger and the "debug:" statement I added. We also did a string-length and it was 0.
Thanks a lot for your help so many times!
Neal
Subject:Testing for empty string - something obvious not working Author:Neal Walters Date:04 May 2006 06:55 PM Originally Posted: 04 May 2006 06:51 PM
You're right on again. <br>
<br>
But how could a string be NaN (not-a-number)? Is NaN the way XSLT expresses Null? <br>
Why doesn't the debugger show NaN?
<br>
Is there somewhere I can go to read about NaN vs Null vs empty-string in XSLT? <br>
<br>
Thanks,<br>
Neal <br>
P.S. I think my messages get messed up when I click edit, then change them.