Link to home
Start Free TrialLog in
Avatar of Vakils
VakilsFlag for United States of America

asked on

Java: Split XML with multiple roots.

I need to split an xml file which has multiple roots into files having one root. How can I achieve this?
Avatar of mccarl
mccarl
Flag of Australia image

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?
Avatar of Vakils

ASKER

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.
GamerProfile.txt
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial