XPath and price filter

LegacyForumLegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Hi all,

There is any way to insert an price filter (like "/bookstore/book[price>35]/price") in the XPAth above?

/*[local-name(.)="Envelope" and namespace-uri(.)="http://.../"]
/*[local-name(.)="Body" and namespace-uri(.)="http://.../"]
/*[local-name(.)="response" and namespace-uri(.)="http://..."]
/*[local-name(.)="price" and namespace-uri(.)="http://..."]
/*[local-name(.)="totalAmount" and namespace-uri(.)="..."]


  • LegacyForumLegacyForum Posts: 1,664 ✭✭
    I've created a sample .tst file for you that has a very simple XML for books and prices. The XPath I used is in the XML Transformer, and I've copied it below:
    /*[local-name(.)="Envelope" and namespace-uri(.)="http://schemas.xmlsoap.org/soap/envelope/"]
    /*[local-name(.)="Body" and namespace-uri(.)="http://schemas.xmlsoap.org/soap/envelope/"]
    /*[local-name(.)="root" and namespace-uri(.)=""]
    /*[local-name(.)="book" and namespace-uri(.)=""][price<13]
    /*[local-name(.)="price" and namespace-uri(.)=""]/text()

    Hope this helps.
  • LegacyForumLegacyForum Posts: 1,664 ✭✭
    Thanks Joseph.

    Yes, it works. The final query:

    /*[local-name(.)="Envelope" ]
    /*[local-name(.)="Body" ]
    /*[local-name(.)="response" ]
    /*[local-name(.)="lineItemList" ]
    /*[local-name(.)="lineItem" ]
    /*[local-name(.)="price" ]
    /*[local-name(.)="totalAmount" ][.>0]
Sign In or Register to comment.