Hi Aman,

You can use filter mediator[1]. And as the 'source', you can use an xpath
like '//Persons/Names/D'. If a value is there in this xpath, whatever the
logic you write in the 'then' part will execute. Or else the control will
go to 'else' part.

[1] https://docs.wso2.com/display/EI630/Filter+Mediator

Thanks,
Thishani

On Fri, Sep 14, 2018 at 3:28 PM, Aman Singh <amansingh0...@gmail.com> wrote:

> Hi all,
>
> I am very new to transformation in WSO2. Actually I want to perform a
> transformation,  suppose there are 2 XML messages. I can pass any one of
> them by keeping them inside Payload Factory. The format of both are as
> below:-
>
> *Message 1:-*
> <Persons>
> <Names>
> <A>value</A>
> <B>value</B>
> <C>value</C>
> </Names>
> </Persons>
>
> *Message 2:-*
> <Persons>
> <Names>
> <A>value</A>
> <B>value</B>
> <C>value</C>
> <D>value</D>
> <E>value</E>
> <F>value</F>
> </Names>
> </Persons>
>
> Now, if the message is of format 1 (Message 1) then, choice 1 will run
> otherwise if its of second format(Message 2), then 2nd choice will run [I
> want to use choice condition to do this] .
> Can someone please hep me with code syntax of how can I check this.
> Detailed explanation would be very much appreciated for a newbie like me.
>
> Thank you,
> Aman.
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Thishani Lucas*
*Software Engineer*
*WSO2 Lanka (Private) Limited**: http://wso2.com <http://wso2.com/>*
*lean.enterprise.middle-ware*

*Tel: +94 77 2556931 *

*LinkedIn: https://www.linkedin.com/in/thishani-lucas/
<https://www.linkedin.com/in/thishani-lucas/>*


<http://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to