I need to split an xml file which has multiple roots into files having one root. How can I achieve this?
Can you provide example of the file that you wish to process? Also, you mention Java in the title, is this what you are looking to implement a solution with? Can you provide some more info on the context of what you are trying to do? i.e. a web app, a console app, one off, etc? Also, is this part of a larger solution of just something standalone?
I do not have to use Java to split file, it can be any tool accessible in Windows, I do have C++. The xml parser is in java(web app), but it will not load because of multiple roots. So I have to split into multiple files based on each root. Then the parser can pick up the file and process. I cannot change parsing code, or the xml structure. I cannot ask vendor to give me multiple files, so I am stuck with splitting the file. Attached is an example with multiple roots. The loader of portion of java web application picks up the file.