activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giovani Seben (JIRA)" <>
Subject [jira] Updated: (AMQ-2179) XPath selector fails to select messages correctly when the expression evaluates to 'true'
Date Tue, 24 Mar 2009 16:32:42 GMT


Giovani Seben updated AMQ-2179:

    Attachment: AMQ-2179.patch

Patch for the issue is attached.

Note that, the selectNodeIterator check is still attempted to maintain previous functionality.
In the case of selecting an empty element selectNodeIterator would return true while eval()
returns false. 

The fix adds more flexibility to the XPath expressions that can be used and
was update to to test a wider range of comparisons.

> XPath selector fails to select messages correctly when the expression evaluates to 'true'

> ------------------------------------------------------------------------------------------
>                 Key: AMQ-2179
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Selector
>    Affects Versions: 5.0.0, 5.1.0, 5.2.0
>         Environment: Windows XP
>            Reporter: Giovani Seben
>             Fix For: 5.3.0
>         Attachments: AMQ-2179.patch
> Currently the XalanXPathEvaluator class will return 'true' or 'false' based on the existence
of a node in the XML document that matches the XPath expression. However, XPath expressions
themselves can return values of true or false based on a comparison criteria. 
> For example, for an input message:
> {code}
> <root>
>   <a key='first' num='1'/>
>   <b key='second' num='2'>b</b>
> </root>
> {code}
> A consumer using an XPath selector with an expression such as: 
> {code}
> XPATH '/root/b="b"'
> {code}
> should successfully select and consume the message above. 
> The evaluator today would attempt to retrieve a XML node with that expression, but it
would fail and return false since the returned value of the expression is a Boolean.
> The XPath Selector should be able to handle Boolean expressions.

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

View raw message