on 06-06-2021 7:22 PM
Hi All,
Hope you and your family are doing great!!
I need help to achieve one scenario.
Input structure is:
<data>
<record>
<name>john</name> <city>pune</city> <doc_no>1</doc_no>
</record>
<sub_record>
<doc_no>1</doc_no> <empid>321</empid> <asset>cpu</asset>
</sub_record>
<record>
<name>mark</name> <city>delhi</city> <doc_no>2</doc_no>
</record>
<sub_record>
<doc_no>2</doc_no> <empid>44</empid> <asset>computer</asset>
</sub_record>
<sub_record>
<doc_no>2</doc_no> <empid>89</empid> <asset>mouse</asset>
</sub_record>
</data>
Key is doc_no and output that I need is :
<?xml version="1.0" encoding="UTF-8"?>
<data>
<header>
<name>john</name><city>pune</city><doc_no>1</doc_no>
<sub_record>
<empid>321</empid><asset>cpu</asset>
</sub_record>
</header>
<header>
<name>mark</name><city>delhi</city><doc_no>2</doc_no>
<sub_record>
<empid>44</empid><asset>computer</asset>
</sub_record>
<sub_record>
<empid>89</empid><asset>mouse</asset>
</sub_record>
</header>
</data>
Can you please help me to identify which node functions are used to get the desired output.
Appreciate your help in advance.
Thanks,
Divya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey pandeydivya82,
It seems to be just a structural change in the output and removing the doc_no field in the sub_record node.
Try to do the one to one mapping and just change the contexts of the input if required. I don't think any node-functions is required for this.
Lots of blog post are already available in the community on node functions, I would suggest you to go through them.
Regards,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.