You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Giovani Seben (JIRA)" <ji...@apache.org> on 2009/03/24 17:22:42 UTC

[jira] Updated: (AMQ-2179) XPath selector fails to select messages correctly when the expression evaluates to 'true'

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

Giovani Seben updated AMQ-2179:
-------------------------------

    Description: 
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.

  was:
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/text()="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.


> XPath selector fails to select messages correctly when the expression evaluates to 'true' 
> ------------------------------------------------------------------------------------------
>
>                 Key: AMQ-2179
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2179
>             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
>
>
> 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.