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/