Quantcast
Channel: Java - Split XML file that contains many loops - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Java - Split XML file that contains many loops

$
0
0

My question is simple for some and just impossible for others (like me)

I have an XML file and I want to split it into small XML files, of course I've to split it when I reach certain count on <DOCUMENT> Element, I've to put 60 <DOCUMENT> in each small XML file.

My document is formated like that :

<DOCS><PIL><ELEMENT1><ELEMENT2>                   <ELEMENT1><PIL><DOCUMENT><ELEMENT1><ELEMENT2><ELEMENT3><ELEMENT4><SUBELEMENT1><ELEMENT1><ELEMENT1><ELEMENT1></SUBELEMENT1><SUBELEMENT2><ELEMENT1><ELEMENT1><ELEMENT1></SUBELEMENT2></ELEMENT4><ELEMENT5><ELEMENT6></DOCUMENT></DOCS>

So my question is how can I split it having 60 <DOCUMENT> in each file ? and do it very quick.

If someone have a solution using Talend that would be great. knowing that using tXMLOutput I can split it but it will only take one element from each loop and all the element of my "document" loop


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images