DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22102>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

XPATH not performing implicit conversion from int to boolean as expected

           Summary: XPATH not performing implicit conversion from int to
                    boolean as expected
           Product: XalanJ2
           Version: 2.3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Xalan
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Using Xalan version 2.3.1 as distributed with Netbeans 3.5.

It appears that the implicit conversion of certain types to booleans does not 
work as expected. We have a stylesheet with the following template matching 
logic.

<xsl:template match="record[normalize-space(field)]">

This correctly evaluates the template if the node record/field contained a non-
empty string. We discovered that performing the following always evaluated to 
false:

<xsl:template match="record[string-length(normalize-space(field))]">

Given that string-length() returns 0 for empty strings, should this not be 
implicitly converted to a boolean 'false'? Especially as the following works as 
expected:

<xsl:template match="record[boolean(string-length(normalize-space(field)))]">

The problem we saw was that the implicit conversion from int to boolean did not 
seem to take place in this case.

Reply via email to