Hi all,
I have a requirement to split xml file into 2 files based on condition ( 'ID' FIELD)
The HEADER and INFORMATION should be there in all files along with the condition.
Input file:-
<?xml version="1.0" encoding="UTF-8"?>
<TRANSACTION>
<HEADER>
<NAME>ALEX</NAME>
</HEADER>
<ID>11111
<TRANSACTION>
<TRANSACTION>
<HEADER>
<NAME>BEN</NAME>
</HEADER>
<ID>22222
<TRANSACTION>
<TRANSACTION>
<HEADER>
<NAME>JOHN</NAME>
</HEADER>
<ID>11111
<TRANSACTION>
<TRANSACTION>
<HEADER>
<NAME>MARK</NAME>
</HEADER>
<ID>22222
<TRANSACTION>
Expected Output:-
File1:-
condition:: (if 5,5,ch,eq,c'11111')
<?xml version="1.0" encoding="UTF-8"?>
<TRANSACTION>
<HEADER>
<NAME>ALEX</NAME>
</HEADER>
<ID>11111
<TRANSACTION>
<TRANSACTION>
<HEADER>
<NAME>JOHN</NAME>
</HEADER>
<ID>11111
<TRANSACTION>
File2:-
condition:: condition:: (if 5,5,ch,eq,c'22222')
<?xml version="1.0" encoding="UTF-8"?>
<TRANSACTION>
<HEADER>
<NAME>BEN</NAME>
</HEADER>
<ID>22222
<TRANSACTION>
<TRANSACTION>
<HEADER>
<NAME>MARK</NAME>
</HEADER>
<ID>22222
<TRANSACTION>