Nikila,
What I would do is read through the child elements of the document root.
As you read through them, I would write them to another file. After you
write each element, flush the writer so that the file is written to, then
check it's length. If you find that the file is too long, then you can trim
the file down (I would store the length of the file before that point).
You have to make sure that you write the document element for each file
that you write out as well, so after you write the fragments to one file,
make sure you write the closing document element, and then open a new file
with a new document element.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"nikila" <ni*****@yahoo.comwrote in message
news:OE*************@TK2MSFTNGP05.phx.gbl...
Hi,
I am trying to split large xml files to smaller xml files using c#.net.
can you please provide any sample code for this? I have to split the file
if the size is more than 10 MB.
Also, xml files after splitting should be valid xml. i am new to Csharp?
Thanks for your help
Nikila