473,221 Members | 2,041 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,221 software developers and data experts.

Best approach to splitting 1 file containing multiple xml docs

Hi

I'm faced with the situation where I could have a single physical file that
could contain multiplie XML documents e.g

file.txt contains the following:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE doc SYSTEM "1.0b.dtd">
<doc transmission-date="20050715T154340Z" >
<blah seq="6289" xml:lang="en-us" >
stuff here
</blah>
</doc>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE doc SYSTEM "1.0b.dtd">
<doc transmission-date="20050715T154340Z" >
<blah seq="6289" xml:lang="en-us" >
stuff here
</blah>
</doc>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE doc SYSTEM "1.0b.dtd">
<doc transmission-date="20050715T154340Z" >
<blah seq="6289" xml:lang="en-us" >
stuff here
</blah>
</doc>

Does anybody have any good advice on the best way to load, split and parse
the xml documents using c#?

Thanks
Nov 12 '05 #1
1 1711
Hi Andy,

You can use StreamReader to read the .txt file, and StreamWriter to split/write them into multiple xml docs.

Here're the documentation and examples:
http://msdn.microsoft.com/library/en...asp?frame=true
http://msdn.microsoft.com/library/en...asp?frame=true

-- Yingzi

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
--------------------
Thread-Topic: Best approach to splitting 1 file containing multiple xml docs
thread-index: AcWMPXQLaV/VXze8RaKFhbKoLj9lfg==
X-WBNR-Posting-Host: 212.187.154.100
From: =?Utf-8?B?QW5keSBCcml0Y2xpZmZl?= <An************@discussions.microsoft.com>
Subject: Best approach to splitting 1 file containing multiple xml docs
Date: Tue, 19 Jul 2005 01:40:02 -0700
Lines: 33
Message-ID: <09**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.xml
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.xml:7771
X-Tomcat-NG: microsoft.public.dotnet.xml

Hi

I'm faced with the situation where I could have a single physical file that
could contain multiplie XML documents e.g

file.txt contains the following:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE doc SYSTEM "1.0b.dtd">
<doc transmission-date="20050715T154340Z" >
<blah seq="6289" xml:lang="en-us" >
stuff here
</blah>
</doc>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE doc SYSTEM "1.0b.dtd">
<doc transmission-date="20050715T154340Z" >
<blah seq="6289" xml:lang="en-us" >
stuff here
</blah>
</doc>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE doc SYSTEM "1.0b.dtd">
<doc transmission-date="20050715T154340Z" >
<blah seq="6289" xml:lang="en-us" >
stuff here
</blah>
</doc>

Does anybody have any good advice on the best way to load, split and parse
the xml documents using c#?

Thanks


Nov 12 '05 #2

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

Similar topics

5
by: steve | last post by:
Hi, I finally figured out the best way to synch local and remote script folders, containing many php script files. What I used to do before was try to ftp all the changed files, etc. which was...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
20
by: Ed | last post by:
I am running Access 2002 and just ran the built in Access wizard for splitting a database into a back end (with tables) and front end (with queries, forms, modules, etc.). After running the...
5
by: moumou | last post by:
Hello world ! This may be a naive question, so I apologize in advance ! I'm wonderting if it is possible to find a program that takes a C source code file and split it into multiple files, one...
1
by: Nelson Smith | last post by:
I have created a web based application using .net frame work 1.1. It has several modules (I mean screens). Some of the screens are used by shipping department; some of them are used by purchase...
15
by: Rob Meade | last post by:
Hi all, I have a databse which I'm pulling the data from for my ASP page. I have 4 tables, Course, Feature, Objective, and PreRequisite. The last three all contain a course product code and a...
13
by: processoriented | last post by:
I am trying to find the best approach to do something here... situation is this... One of the tables in my dataset is a "Work Order" table with information about what needs to be done and where. ...
4
by: Alvin SIU | last post by:
Hi all, I have 6 tables inside a MS Access 2003 mdb file. I want to convert them as DB2 version -8 tables in AIX 5.2. I have exported them as 6 XML files. The XML files look fine. Each...
2
by: Ashley | last post by:
hey, what's up............................. "Neil" <nospam@nospam.netwrote in message news:8YFwj.10509$0o7.1113@newssvr13.news.prodigy.net...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.