473,385 Members | 1,907 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,385 software developers and data experts.

Concatenate xml files

Hi to all,

Is it possible with the .net framework to concatenate xml files?

I have a number of xml files on disk and want to create one file which will
have the format :

<files>
<file filename="a.xml" directory="c:\data\">
xml contents of file a.xml go here
</file>
<file filename="b.xml" directory="c:\data\">
xml contents of file a.xml go here
</file>
...
</files>

Sham
May 5 '06 #1
1 2309


sham wrote:

Is it possible with the .net framework to concatenate xml files?

I have a number of xml files on disk and want to create one file which will
have the format :

<files>
<file filename="a.xml" directory="c:\data\">
xml contents of file a.xml go here
</file>
<file filename="b.xml" directory="c:\data\">
xml contents of file a.xml go here
</file>
...
</files>


What you want to do there is not possible in general, imagine any of
those XML documents has an XML declaration and/or a !DOCTYPE
declaration, if you simply copied the complete XML markup inside of
<file>
</file>
then the result is not well-formed.
So you need to be more specific on what exactly you want to copy
(perhaps the root element?), then it is certainly possible to use
various .NET tools like XmlReader/Writer or XSLT to construct your
result document.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
May 5 '06 #2

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

Similar topics

1
by: Mike James | last post by:
I admit it. I'm a newbie... I want to concatenate a series of text files by recursively going down a folder hierarchy. All the files have the same extension (*.txt) and I'm running WinXP Home...
5
by: gwarning! | last post by:
Goal: Have multiple text files, each of various lengths, be concatenated together into one final consolidated text file. Problem: Since the names of the files to be concatenated can change from...
13
by: jt | last post by:
I can't seem to find a way to concatenate strings that have nulls within the string. I have a string that I need another string that has nulls in it and what to append the 2nd string, 3 string...
3
by: Dave | last post by:
I need to concatenate serveral text files into a larger file. I borrowed some code and patched together a batch file that runs in the command processor and looks like this: echo off chdir...
14
by: J.S. | last post by:
In a Windows Form application, which is the better method to concatenate large blocks of code? 1. Reading the text from text files. 2. Adding the text to the VB file itself? Thanks! J.S. ...
6
by: Sheldon | last post by:
Hi, I am trying to build a large array using concatenate function in python. So as I loop over the number of arrays, of which there are 12 (4 down and 3 across), I create 3 long arrays by...
2
by: ffimbel | last post by:
Hi, I would like to find out the fastest way to concatenate large (200 or 300MB) and numerous (500 - 700) files (Postscript files) into a single one (which can ends up being several GigaB)...
1
by: kgk | last post by:
I would like to concatenate several file-like objects to create a single file-like object. I've looked at fileinput, however this returns a fileinput object that is not very file-like. ...
2
by: Bint | last post by:
is there any way to concatenate files in PHP? thanks B
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.