Xpath in mule anypoint studio



I need to use a choice router to route messages based on a particular field value in input XML. I am using latest version of anypoint studio. I am not able to use XPath to retrieve and compare the value in a particular field and then route it accordingly. Can someone let me know how to use Xpath to compare the carrier field to UPS. Here is the sample XML file:



<?xml version="1.0" encoding="UTF-8"?>
<deliver-order xmlns="http://ift.tt/1usw1SW"
google-order-number="841171949013218">
<tracking-data>
<carrier>UPS</carrier>
<tracking-number>Z5498W45987123684</tracking-number>
</tracking-data>
<send-email>true</send-email>
</deliver-order>


I need to retrieve carrier field from the above xml. I am using xpath expressiosn in choice router like #[xpath('/deliver-order/tracking-data/carrier' == 'UPS']


1 comment:

  1. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    Digital Marketing Training in Chennai

    Digital Marketing Course in Chennai

    ReplyDelete