Tom,

I think the point is that the variable created contains just a single root
node with no children and
since a " node-set is true if and only if it is non-empty" TRUE is
returned.   See sections 11.2 XSLT
second bullet,  and Xpath 4.3 (Boolean) second bullet as well.

Paul


                                                                                       
                        
                    Tom Amiro                                                          
                        
                    <Tom.Amiro@Su        To:     "[EMAIL PROTECTED]" 
<[EMAIL PROTECTED]>         
                    n.COM>               cc:     (bcc: Paul Dick/CAM/Lotus)            
                        
                                         Subject:     test boolean43 seems wrong       
                        
                    07/11/2001                                                         
                        
                    11:43 AM                                                           
                        
                    Please                                                             
                        
                    respond to                                                         
                        
                    xalan-dev                                                          
                        
                                                                                       
                        
                                                                                       
                        




I've puzzled over conf test boolean43 and can't figure out why
the expected result of "true" is correct. Note the xml doc does not
have a "foo" element. Indeed, Xalan, XT,  and Saxon return
"true" on this test. XSLTC returns "false". We're outnumbered,
but it looks to me like "false" is the correct answer.

Here's the xsl

  <xsl:variable name="emptyResultTreeFragTest">
    <xsl:value-of select="foo"/>
  </xsl:variable>

  <xsl:template match="doc">
    <out>
      <xsl:value-of select="boolean($emptyResultTreeFragTest)"/>
    </out>
  </xsl:template>

I checked the string-length of  the "emptyResultTreeFragTest"
variable and it was 0. I also explicitly converted it to a string
with the string function and printed it out. That showed an
empty string.

So I don't see how applying the boolean function to the variable
can return "true". The XSLT spec says a node-set is true only
if it is non-empty and that a string is true if and only if its
length is non-zero.

What am I missing?

Tom







Reply via email to