abdul aziz

abdul aziz

  • NA
  • 3
  • 0

How to Split the Xml into Multiple Files if the File size exceeds 10MB

Jan 25 2012 12:39 AM

How to Split the XML into Dynamic Multiple Files if the File size exceeds 10MB

the Below one is my XML.
<employees>
<employee>
<FirstName> abdul</FirstName>
</employee>
<employee>
<FirstName> abdul1</FirstName>
</employee>
<employee>
<FirstName> abdul2</FirstName>
</employee>
<employee>
<FirstName> abdul3</FirstName>
</employee>
<employee>
<FirstName> abdul4</FirstName>
</employee>
<employee>
<FirstName> abdul5</FirstName>
</employee>
<employee>
<FirstName> abdul6</FirstName>
</employee>
<employee>
<FirstName> abdul7</FirstName>
</employee>
<employee>
<FirstName> abdul8</FirstName>
</employee>
<employee>
<FirstName> abdul9</FirstName>
</employee>
<employee>
<FirstName> abdul10</FirstName>
</employee>
.
.
.
.
.
.
.
.
.
.
.
</employees>

if the file exceeds 10MB i want to Split it into two chunks based on the Xml and the file name should be dynamic and the xml should be like the below

firstXml.xml
<employees>
<employee>
<FirstName> abdul</FirstName>
</employee>
<employee>
<FirstName> abdul1</FirstName>
</employee>
<employee>
<FirstName> abdul2</FirstName>
</employee>
<employee>
<FirstName> abdul3</FirstName>
</employee>
<employee>
<FirstName> abdul4</FirstName>
</employee>
</employees>
second xml file:

<employees>
<employee>
<FirstName> abdul5</FirstName>
</employee>
<employee>
<FirstName> abdul6</FirstName>
</employee>
<employee>
<FirstName> abdul7</FirstName>
</employee>
<employee>
<FirstName> abdul8</FirstName>
</employee>
<employee>
<FirstName> abdul9</FirstName>
</employee>
</employees>


Answers (1)