on 03-18-2014 7:06 PM
Hi ExpertALL,
I need support, check the source and target structures.
Source structure below:
Target structure:
As you can see the structure "item" it´s unbound, means repeat many times, inside <item> there is a tag <TYPE> that´s cointains two values "S" or "E".
Check the part of request XML below:
<T_RETURN>
<item>
<TYPE>S</TYPE>
<MESSAGE>Lote baixado com sucesso !!!</MESSAGE>
<MESSAGE_V1>AC13033621</MESSAGE_V1>
<SYSTEM/>
</item>
<item>
<TYPE>E</TYPE>
<MESSAGE>ERROR!</MESSAGE>
<MESSAGE_V1>AC13033622</MESSAGE_V1>
</item>
<item>
<TYPE>S</TYPE>
<MESSAGE>Lote baixado com sucesso !!!</MESSAGE>
<MESSAGE_V1>AC13033623</MESSAGE_V1>
</item>
<item>
<TYPE>E</TYPE>
<MESSAGE>ERROR!</MESSAGE>
<MESSAGE_V1>AC13033624</MESSAGE_V1>
</item>
</T_RETURN>
What I need to do, when the value of tag <TYPE> only once comes with value "E", I need insert value "1" into tag <ERROR> in response structure.
If contains only "S" leave <ERROR>blank</ERROR>
Like this exemple below:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_OUTPUT xmlns:ns1="zurn:greefa.fischer">
<E_EMAIL>xpto@teste.com</E_EMAIL>
<RESPOSTA>
<TYPE>S</TYPE>
<MESSAGE_V1>AC13033621</MESSAGE_V1>
</RESPOSTA>
<RESPOSTA>
<TYPE>E</TYPE>
<MESSAGE_V1>AC13033622</MESSAGE_V1>
</RESPOSTA>
<RESPOSTA>
<TYPE>S</TYPE>
<MESSAGE_V1>AC13033623</MESSAGE_V1>
</RESPOSTA>
<RESPOSTA>
<TYPE>S</TYPE>
<MESSAGE_V1>AC13033624</MESSAGE_V1>
</RESPOSTA>
<ERROR>1</ERROR>
</ns1:MT_OUTPUT>
Suggestions ?
Kind regards,
Ricardo Viana.
Hi Ricardo - Did you try
Type -> remove context -> sort(ascending)-> equalS(E) -> if without else(1) -> target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.