[ https://issues.apache.org/jira/browse/XALANJ-2379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489530 ]
Joe commented on XALANJ-2379: ----------------------------- Ooooh...text() returns a set of text nodes instead of a string...that makes sense now. I had thought that it returned the text of the current node in a similar fashion as ".". So, if doing a text comparison, it returns a concatenated string of all the child text nodes and compares it against the second operand, unless there are no children, in which case the logic test would fail (because there are no child text nodes.) I think I understand it now. Sorry to waste your time with this bug report, but thank you for explaining why this is the correct method for X-Path. > 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]