You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Domke, Alexander" <a....@cenit.com.INVALID> on 2020/08/21 10:02:38 UTC

xpath with simple expression

Hello everybody!

I am desperately trying to use the Camel Simple Expression in XPath.

Sample:

        <setHeader headerName="Price">
            <constant>25</constant>
        </setHeader>

        <setHeader headerName="Books">
            <xpath>/bookstore/book[price > ${header.Price}]/title </xpath>
        </setHeader>

Apparently xpath cannot find the "Price" header.
All my attempts have failed and I wanted to ask if anyone of you has an idea why?


Greeting
Alex

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Kurt Bengel, Matthias Schmidt, Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Prof. Dr. Oliver Riedel (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Stephan Gier, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

AW: xpath with simple expression

Posted by "Domke, Alexander" <a....@cenit.com.INVALID>.
Hello Giovanni, 
thanks for the tip! I'll try this out in a moment.

Thank you!

-----Ursprüngliche Nachricht-----
Von: Giovanni Condello [mailto:giovanni.condello@coderit.it] 
Gesendet: Freitag, 21. August 2020 12:07
An: users@camel.apache.org
Betreff: R: xpath with simple expression

Hi,

the Camel doc shows there's a custom function to access headers and body. 
https://camel.apache.org/components/latest/languages/xpath-language.html


Somehting like this should work 
        <setHeader headerName="Price">
            <constant>25</constant>
        </setHeader>

        <setHeader headerName="Books">
            <xpath>/bookstore/book[price > in:header("Price")]/title </xpath>
        </setHeader>

Cheers

Giovanni Condello
Mobile: +39 393.87.30.542
Address: via Colico, 12/A - 20158 Milano (MI), Italy
Website: www.coderit.it
Confidentiality Statement: The information contained in this message may be privileged and/or confidential and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copy of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this message and deleting the material from any computer. Thank you.


-----Messaggio originale-----
Da: Domke, Alexander <a....@cenit.com.INVALID> 
Inviato: venerdì 21 agosto 2020 12:03
A: users@camel.apache.org
Oggetto: xpath with simple expression

Hello everybody!

I am desperately trying to use the Camel Simple Expression in XPath.

Sample:

        <setHeader headerName="Price">
            <constant>25</constant>
        </setHeader>

        <setHeader headerName="Books">
            <xpath>/bookstore/book[price > ${header.Price}]/title </xpath>
        </setHeader>

Apparently xpath cannot find the "Price" header.
All my attempts have failed and I wanted to ask if anyone of you has an idea why?


Greeting
Alex

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken Vorstandsmitglieder (Members of the Board): Kurt Bengel, Matthias Schmidt, Markus Wesel Aufsichtsratsmitglieder (Supervisory Board Members): Prof. Dr. Oliver Riedel (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Stephan Gier, Ricardo Malta Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS, Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600, Registergericht (Registry court): Amtsgericht Stuttgart Handelsregister (Commercial Register): HRB Nr. 19117 Umsatzsteuer (VAT) ID: DE 147 862 777

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Kurt Bengel, Matthias Schmidt, Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Prof. Dr. Oliver Riedel (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Stephan Gier, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777


R: xpath with simple expression

Posted by Giovanni Condello <gi...@coderit.it>.
Hi,

the Camel doc shows there's a custom function to access headers and body. 
https://camel.apache.org/components/latest/languages/xpath-language.html


Somehting like this should work 
        <setHeader headerName="Price">
            <constant>25</constant>
        </setHeader>

        <setHeader headerName="Books">
            <xpath>/bookstore/book[price > in:header("Price")]/title </xpath>
        </setHeader>

Cheers

Giovanni Condello
Mobile: +39 393.87.30.542
Address: via Colico, 12/A - 20158 Milano (MI), Italy
Website: www.coderit.it
Confidentiality Statement: The information contained in this message may be privileged and/or confidential and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copy of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this message and deleting the material from any computer. Thank you.


-----Messaggio originale-----
Da: Domke, Alexander <a....@cenit.com.INVALID> 
Inviato: venerdì 21 agosto 2020 12:03
A: users@camel.apache.org
Oggetto: xpath with simple expression

Hello everybody!

I am desperately trying to use the Camel Simple Expression in XPath.

Sample:

        <setHeader headerName="Price">
            <constant>25</constant>
        </setHeader>

        <setHeader headerName="Books">
            <xpath>/bookstore/book[price > ${header.Price}]/title </xpath>
        </setHeader>

Apparently xpath cannot find the "Price" header.
All my attempts have failed and I wanted to ask if anyone of you has an idea why?


Greeting
Alex

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken Vorstandsmitglieder (Members of the Board): Kurt Bengel, Matthias Schmidt, Markus Wesel Aufsichtsratsmitglieder (Supervisory Board Members): Prof. Dr. Oliver Riedel (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Stephan Gier, Ricardo Malta Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS, Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600, Registergericht (Registry court): Amtsgericht Stuttgart Handelsregister (Commercial Register): HRB Nr. 19117 Umsatzsteuer (VAT) ID: DE 147 862 777