commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Vladimirov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JXPATH-93) Binary operators behaviour involving node-sets is incorrect
Date Thu, 12 Jul 2007 08:00:10 GMT

     [ https://issues.apache.org/jira/browse/JXPATH-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Vladimirov updated JXPATH-93:
------------------------------------

    Attachment: testcase-patch.txt

Test case update

> Binary operators behaviour involving node-sets is incorrect
> -----------------------------------------------------------
>
>                 Key: JXPATH-93
>                 URL: https://issues.apache.org/jira/browse/JXPATH-93
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>         Environment: 1.2, SVN version
>            Reporter: Sergey Vladimirov
>             Fix For: 1.3
>
>         Attachments: testcase-patch.txt
>
>
> According to XPath specification:
> "If both objects to be compared are node-sets, then the comparison will be true if and
only if there is a node in the first node-set and a node in the second node-set such that
the result of performing the comparison on the string-values of the two nodes is true. If
one object to be compared is a node-set and the other is a number, then the comparison will
be true if and only if there is a node in the node-set such that the result of performing
the comparison on the number to be compared and on the result of converting the string-value
of that node to a number using the number function is true."
> But following example illustrates, that this is not a JXPath behaviour:
>         JXPathContext pathContext = JXPathContext
>                 .newContext(DocumentBuilderFactory.newInstance()
>                         .newDocumentBuilder().parse(
>                                 new InputSource(new StringReader(
>                                         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
>                                                 + "<doc/>"))));
>         Boolean result = (Boolean) pathContext.getValue("2.0 > child1",
>                 Boolean.class);
>         assertFalse(result.booleanValue());
> "child1" is not found - right operand node set is empty, but result is TRUE, instead
of FALSE.
> Please, check greaterThan(), lesserThan(), etc methods of org.apache.xpath.objects.XObject
for possible solution :)

-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message