473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Split Multiple XML Documents from a Single File

I have a client that transmits a file to us with many XML documents enclosed. The problem is that each is a different format and may have different encodings as they contain information from many different countries. We can handle all the different documents when they are split into single files and we currently have a cluge to do this.

I was wondering if someone has a good idea to perform this same process in C#. I know I can open the file in binary mode and look at each character and find where one document ends and the next starts but I am wondering if this is the best method of doing this. Any samples or ideas are greatly appreciated.

Thanks,

Matt
Jun 9 '06 #1
2 3378
Hello Matt,

What's wrong with the current process?
Since you xml file even in not well-formed you can't rely on XML parses -
everything you can do is to parse it manually

Is it possible to change the client side to send files separately?

M> I have a client that transmits a file to us with many XML documents
M> enclosed. The problem is that each is a different format and may
M> have different encodings as they contain information from many
M> different countries. We can handle all the different documents when
M> they are split into single files and we currently have a cluge to do
M> this.
M>
M> I was wondering if someone has a good idea to perform this same
M> process in C#. I know I can open the file in binary mode and look at
M> each character and find where one document ends and the next starts
M> but I am wondering if this is the best method of doing this. Any
M> samples or ideas are greatly appreciated.
M>
M> Thanks,
M>
M> Matt
M>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jun 9 '06 #2
Michael,

The current process is slow and cumbersome with a VB6 program. No the customer batches up all days work and transmits the single file to us. For some reason they feel it is cheaper to have them all together when transmitting, of course the batch does contain some 24k documents.

We want to use C# and try to make the process faster and cleaner. We know we cannot use any DOM but I was looking to the group to see if anyone knows of a way to quickly split them out but since there are different encodings you cannot look at the file as string, we tried this and it failed miserably. I know I can read each byte and look for the beginning of each XML document but I was hoping that their may be something faster and easier in .Net 2.0 that I had not run across yet to help out.

Thanks,

Matt
"Michael Nemtsev" <ne*****@msn.com> wrote in message news:9c**************************@msnews.microsoft .com...
Hello Matt,

What's wrong with the current process?
Since you xml file even in not well-formed you can't rely on XML parses -
everything you can do is to parse it manually

Is it possible to change the client side to send files separately?

M> I have a client that transmits a file to us with many XML documents
M> enclosed. The problem is that each is a different format and may
M> have different encodings as they contain information from many
M> different countries. We can handle all the different documents when
M> they are split into single files and we currently have a cluge to do
M> this.
M>
M> I was wondering if someone has a good idea to perform this same
M> process in C#. I know I can open the file in binary mode and look at
M> each character and find where one document ends and the next starts
M> but I am wondering if this is the best method of doing this. Any
M> samples or ideas are greatly appreciated.
M>
M> Thanks,
M>
M> Matt
M>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jun 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kumu | last post by:
How to Split a XML file to multiple small XML Files Hello, I am trying to split a XML file to multiple small xml files in vb.net and am trying to get the best possible approach to this. Any help...
2
by: Hollywood | last post by:
After doing a search through google's archives of this list, I didn't see what I was looking for so here goes... Is it possible to serialize/deserialize multiple objects from a single XML file? ...
2
by: Knighterrant | last post by:
How to combine multiple xml files into a single one, or split an xml file into multiple files using xslt?
1
by: PK9 | last post by:
I'm building a windows app using C#. The goal is to merge portions of multiple xml files into one. I currently have an .xsl stylesheet that pulls in the required sections of multiple xml files...
3
by: Bill Nguyen | last post by:
I'm working on a project that requires outputs to be sent to multiple windows on a single monitor. I have no idea whether .NET can provide this capability. Also, is there any utility/control out...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
0
by: Neil | last post by:
Here's a follow-up to my "Concatenating Rich Textbox Controls Into A Single File" message. I didn't get any useful responses to that message, so I assume that there isn't a direct way to create a...
3
by: Jordan S. | last post by:
I would appreciate your thoughts and opinions on the following: I am looking to render documents into multiple document formats. At a minimum the documents will need to be rendered as HTML, and...
7
by: John Smith | last post by:
Hi, I am very new to C# and NET framework. I am trying to hash (using MD5CryptoServiceProvider) a source that is split into several files. Now when the source is in one file I can produce the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.