Click here to Skip to main content
15,906,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Split Xml into Multiple Files(Dynamic) if the file size exceeds 10 MB .
THe Xml should be split with proper nodes and it should be welformed xml.
it should not split from the middle of the xml without any proper nodes.
the below one is my xml structure.
HTML
<claimsubmission>
 <Header>
   <first> abc </first>
 </Header>
<claim>
<encounter>
  <facid>1234 </facid>
</encounter>
   <activity>
<start> 1234</start>
  </activity>
   <observation>
      <type>2333</type>
    </observation>
</claim>
<claim>
<encounter>
  <facid>1234 </facid>
</encounter>
<activity>
<start> 1234</start>
  </activity>
   <observation>
      <type>2333<type>
    </type></type></observation>
</claim>
<claim>
<encounter>
  <facid>1234 </facid>
</encounter>
   <activity>
<start> 1234</start>
  </activity>
   <observation>
      
    </observation>
</claim>
</claimsubmission>


if it is splitting it should split in the below way not from middle.
First.xml:
HTML
<claimsubmission>
 <Header>
   <first> abc </first>
</Header>
<claim>
<encounter>
  <facid>1234 </facid>
</encounter>
   <activity>
<start> 1234</start>
  </activity>
   <observation>
       <Type>2355533</Type>
</observation>
</claim>
</claimsubmission>


Secondxml:
HTML
<claimsubmission>
 <Header>
   <first> abc </first>
</Header>
<claim>
<Encounter>
  <facID>1234234 </facID>
</Encounter>
   <Activity>
<start> 2221234<start>
  </Activity>
   <observation>
      <Type>2355533</Type>
    </observation>
</claim>
</claimSubmission>


third.xml:
HTML
<claimsubmission>
 <Header>
   <first> abc </first>
</Header>
<claim>
<Encounter>
  <facID>1234234 </facID>
</Encounter>
   <Activity>
<start> 2221234<start>
  <Activity>
   <observation>
      <Type>2355533</Type>
    </observation>
</claim>
</claimSubmission>


fourth.xml
HTML
<claimsubmission>
 <Header>
   <first> abc </first>
</Header>
<claim>
<encounter>
  <facid>1234234 </facid>
</encounter>
   <activity>
<start> 2221234<start>
  <activity>
   <observation>
      <type>2355533</type>
    </observation>
</claim>
</claimsubmission>
Posted
Updated 25-Jan-12 6:48am
v3

1 solution

Take a look at this Split large XML files into small files[^] article.
 
Share this answer
 
Comments
Abdul Aziz1234556 26-Jan-12 5:04am    
Thanks for your reply....

I have checked this but it is not splitting as welformed xml.it is splitting without proper xml ,from the middle nodes only it gets splitted and remaining is coming in new file .
Please check it and tell me.

eg:
first xml:
<claim>
<firstname>123

second xml:
<secondname>1223

The above is getting splitted if i am using the above and it is not forming complete xml while splitting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900