You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Gershaw, Geoffrey A. " <ge...@credit-suisse.com> on 2014/11/13 23:31:37 UTC

XPATH woes

Hi All,

I'm trying to filter via xpath using the spring config. I'm running camel 2.12.3.


An example msg

<Envelope xmlns="http://removed " xmlns:bem="http:/removed " xmlns:price="http://removed" messageId="xx" schemaVersion="1.0" instanceId="xx" publishMessageDtm="2014-11-13T22:27:07+00:00" publishMessageDtInMs="2014-11-13T22:27:07.835+00:00" publishingSystemCd="xx">


This below filter always evaluates to false. Any ideas?

<filter>
                           <xpath>/Envelope/@schemaVersion='1.0'</xpath>
                           <camel:log message="${body}"/>
                     </filter>

Thanks


Geoffrey A Gershaw
CREDIT SUISSE
Information Technology | Credit eTrading Development, KFVB 525
7033 Louis Stephens Drive | 27560 Research Triangle Park | United States
Phone +1 919 994 6412
geoffrey.gershaw@credit-suisse.com<ma...@credit-suisse.com> | www.credit-suisse.com<http://www.credit-suisse.com/>




=============================================================================== 
Please access the attached hyperlink for an important electronic communications disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=============================================================================== 

Re: XPATH woes

Posted by Raul Kripalani <ra...@evosent.com>.
Your Envelope element is declared in a default namespace. Your XPath
expression must use the namespace when referring to the element.

Cheers.
On 13 Nov 2014 22:32, "Gershaw, Geoffrey A." <
geoffrey.gershaw@credit-suisse.com> wrote:

> Hi All,
>
> I'm trying to filter via xpath using the spring config. I'm running camel
> 2.12.3.
>
>
> An example msg
>
> <Envelope xmlns="http://removed " xmlns:bem="http:/removed " xmlns:price="
> http://removed" messageId="xx" schemaVersion="1.0" instanceId="xx"
> publishMessageDtm="2014-11-13T22:27:07+00:00"
> publishMessageDtInMs="2014-11-13T22:27:07.835+00:00"
> publishingSystemCd="xx">
>
>
> This below filter always evaluates to false. Any ideas?
>
> <filter>
>                            <xpath>/Envelope/@schemaVersion='1.0'</xpath>
>                            <camel:log message="${body}"/>
>                      </filter>
>
> Thanks
>
>
> Geoffrey A Gershaw
> CREDIT SUISSE
> Information Technology | Credit eTrading Development, KFVB 525
> 7033 Louis Stephens Drive | 27560 Research Triangle Park | United States
> Phone +1 919 994 6412
> geoffrey.gershaw@credit-suisse.com<mailto:
> geoffrey.gershaw@credit-suisse.com> | www.credit-suisse.com<
> http://www.credit-suisse.com/>
>
>
>
>
>
> ===============================================================================
> Please access the attached hyperlink for an important electronic
> communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>
> ===============================================================================
>