on ‎2009 Apr 22 4:42 PM
Hi folks.
I have to follow source XML to map to receiver XML:
source
....
<SERVICE>
<SRVNR>1001</SRVNR>
<MATERIAL>
<MATNR>QWERT</MATNR>
</MATERIAL>
<MATERIAL>
<MATNR>ASDFG</MATNR>
</MATERIAL>
</SERVICE>
<SERVICE>
<SRVNR>2002</SRVNR>
</SERVICE>
<SERVICE>
<SRVNR>3003</SRVNR>
<MATERIAL>
<MATNR>ZXCVB</MATNR>
</MATERIAL>
</SERVICE>
....
receiver must be as follow
....
<MATERIAL>
<SRVNR>1001</SRVNR>
<MATNR>QWERT</MATNR>
</MATERIAL>
<MATERIAL>
<SRVNR>1001</SRVNR>
<MATNR>ASDFG</MATNR>
</MATERIAL>
<MATERIAL>
<SRVNR>3003</SRVNR>
<MATNR>ZXCVB</MATNR>
</MATERIAL>
....
but the result is below
<MATERIAL>
<SRVNR>1001</SRVNR>
<MATNR>QWERT</MATNR>
</MATERIAL>
<MATERIAL>
<SRVNR>2002</SRVNR>
<MATNR>ASDFG</MATNR>
</MATERIAL>
<MATERIAL>
<SRVNR>3003</SRVNR>
<MATNR>ZXCVB</MATNR>
</MATERIAL>
I've tried the code below:
for (int i=0; i<a.length;i++){
result.addValue(b[0]);
}
where the parameter a is my root <MATERIAL> and the parameter b is element <SRVNR>, but the result is wrong.
I've tried node function useOneAsMany but doesn't work too.
My difficult is associate root <SERVER> with corresponding roots <MATERIAL> in the result using either a node function or an user define function.
Someone can help me, please?
Thanks in advanced.
Request clarification before answering.
ss
Edited by: Wolfgang Disch on Apr 28, 2009 5:45 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.