Skip to Content

Content Filter XPath compare Header Value

HI All,

I want to filter the content comparing date with a date node in the content. The date to compare is saved in one of the header variable. Can we access the header variable in the XPath expression? When I used ${header.lastModified} gives me InvalidXPathExpression exception. Tried without curly braces, but the comparison is not working.

Regards,

Anoop

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 13 at 04:01 PM

    Hi Anoop,

    Could you please refer below blog.

    https://blogs.sap.com/2017/06/01/sap-cloud-platform-integration-content-filter-in-detail/

    hope this helps !

    thanks and regards,

    Praveen T

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14 at 04:18 PM

    Hello Anoop,

    Considering, your input structure is in below way -

    <recordset>

    <record>

    <date>20180314</date>

    </record>

    </recordset>


    Then you can write the Xpath expression as /record/recordset[contains(date,$header.lastmodified)]


    Regards,

    Nitin Deshpande

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Nitin,

      I tried with that approach itself, but was not succesful. I removed header and used $lastModified directly and it worked. :)

      Regards,

      Anopo