[ 
https://issues.apache.org/jira/browse/XALANJ-2379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489468
 ] 

Joe commented on XALANJ-2379:
-----------------------------

After reading part of the X-Path specification and looking at the output from 
Xalan-J and MS XML, I see that you are correct.  This is the behavior it should 
be exibiting.  But, if this is the case, then why does this work:

<xsl:variable name="testcase1" select=".=''"/>

Logically looking at this expression, I would think that it grabs the content 
of the current node, and converts it to a string.  But, since there is no 
content within the tags, it should always return false (based on the 
explanation you just gave me.)  Yet, using either Xalan-J or MS XML, it will 
return true if the node is empty.

My thought is, shouldn't "text()" do the same thing?  If not, then I feel this 
is an inconsistency in the X-Path specification itself.


By the way...have you ever noticed how many run-on sentences the X-Path 
specification contains?  It would make an English major cry...lol.

> Empty node text comparisons failing
> -----------------------------------
>
>                 Key: XALANJ-2379
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2379
>             Project: XalanJ2
>          Issue Type: Bug
>    Affects Versions: 2.7
>         Environment: Windows XP SP2, Eclipse 3.2.2 (build M20070212-1330)
>            Reporter: Joe
>            Priority: Critical
>         Attachments: test.xml, test.xsl, test_output.xml
>
>
> When a text comparison on an empty node is performed, it never returns true.  
> For example, if I were to use this variable:
>     <xsl:variable name="testcase1" select="text()=''"/>
> this will always return false.
> Yet, if I do:
>     <xsl:variable name="testcase1" select="string-length(text())=0"/>
> This returns the correct result.
> I will attach a test case to this bug report.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to