Splitting long XML file into smaller pieces

  • Thread starter Thread starter Jenny
  • Start date Start date
J

Jenny

Hello All!

I have a long XML file that I should transmit to other computer using http.
Problem is that the whole XML Document is too large for one
transmitting.

What is the nicest way to split XML document into smaller pieces e.g. to 10
pieces?

XML document is same kind what comes to itäs tags.

E.g.
<main1>
<sub1>text</sub1>
<sub2>text</sub2>
<sub3>text</sub3>
</main1>

<main2>
<sub1>text</sub1>
<sub2>text</sub2>
<sub3>text</sub3>
</main2>

<main3>
<sub1>text</sub1>
<sub2>text</sub2>
<sub3>text</sub3>
</main3>

continues ...

So, how could I read e.g. one main tag with it's subitems one a time?

Br Jenny
 
Jenny,

The XML that you displayed is not valid XML. It doesn't have a root
element. If this is what you are sending down the HTTP pipeline, then I
would recommend in your processing, as you create the separate documents to
send, create separate requests to transfer the documents.
 
XML code was sample, no a real one that's why it didn't have a root element
:)

I have one single xml document that is generated by third party vendor.
So I need some kind of technique to split it into smaller parts.

jenny

Nicholas Paldino said:
Jenny,

The XML that you displayed is not valid XML. It doesn't have a root
element. If this is what you are sending down the HTTP pipeline, then I
would recommend in your processing, as you create the separate documents
to send, create separate requests to transfer the documents.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jenny said:
Hello All!

I have a long XML file that I should transmit to other computer using
http.
Problem is that the whole XML Document is too large for one
transmitting.

What is the nicest way to split XML document into smaller pieces e.g. to
10 pieces?

XML document is same kind what comes to itäs tags.

E.g.
<main1>
<sub1>text</sub1>
<sub2>text</sub2>
<sub3>text</sub3>
</main1>

<main2>
<sub1>text</sub1>
<sub2>text</sub2>
<sub3>text</sub3>
</main2>

<main3>
<sub1>text</sub1>
<sub2>text</sub2>
<sub3>text</sub3>
</main3>

continues ...

So, how could I read e.g. one main tag with it's subitems one a time?

Br Jenny
 
Back
Top