You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by John Dubchak <jo...@johndubchak.com> on 2013/11/14 21:12:50 UTC
xpath filter question
Hi,
I am trying to create a JavaDSL route that filters an incoming XML from
an ActiveMQ queue. The message is being delivered correctly and I can
print it out if I short-circuit it with a processor that dumps the
message. However, removing the processor, I cannot seem to get the
correct xpath expression to match on a particular value:
from("activemq:cdw.Notifications")
.filter()
.xpath("/parent_node[child_node = 'value of text']")
Any insight into what I've messed up?
Thanks,
John
Re: xpath filter question
Posted by Claus Ibsen <cl...@gmail.com>.
Getting xpath expression correct can be tricky. You can use some xpath
eval tool to try this to make sure to get the exp correct.
And mind about namespaces, if the xml has namespaces then its even more tricky.
Some details here
http://camel.apache.org/xpath
And then search the web for java xpath with namespaces how to do that.
On Thu, Nov 14, 2013 at 9:12 PM, John Dubchak <jo...@johndubchak.com> wrote:
> Hi,
>
> I am trying to create a JavaDSL route that filters an incoming XML from an
> ActiveMQ queue. The message is being delivered correctly and I can print it
> out if I short-circuit it with a processor that dumps the message. However,
> removing the processor, I cannot seem to get the correct xpath expression to
> match on a particular value:
>
> from("activemq:cdw.Notifications")
> .filter()
> .xpath("/parent_node[child_node = 'value of text']")
>
> Any insight into what I've messed up?
>
> Thanks,
> John
>
>
>
>
>
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
RE: xpath filter question
Posted by Ra...@cognizant.com.
Can you share the sample xml message ? Does it have namespace in it ?
________________________________________
From: John Dubchak [john@johndubchak.com]
Sent: Friday, November 15, 2013 1:42 AM
To: users@camel.apache.org
Subject: xpath filter question
Hi,
I am trying to create a JavaDSL route that filters an incoming XML from
an ActiveMQ queue. The message is being delivered correctly and I can
print it out if I short-circuit it with a processor that dumps the
message. However, removing the processor, I cannot seem to get the
correct xpath expression to match on a particular value:
from("activemq:cdw.Notifications")
.filter()
.xpath("/parent_node[child_node = 'value of text']")
Any insight into what I've messed up?
Thanks,
John
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful.