Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: appending a new element to an existing xml file >Thread Next - Re: appending a new element to an existing xml file Re: appending a new element to an existing xml fileTo: NULL Date: 3/5/2008 2:56:00 PM ofuuzo1@y... schrieb: > On 5 Mar, 14:23, ofuu...@yahoo.no wrote: >> Hi, >> Is there anyway I can append a new element to an existing xml without >> first loading the existing file into a variable, adding the new >> element into the variable and saving it by overwriting the existing >> file name? >> >> Thanks >> Ofuuzo > > To smplify my question. > I have nth xml files and I want to put all of them together in one xml > file called new.xml. How can I do it? > > Example > > 1.xml > <head> > <title>Test1</title> > .... > </head> > > 2.xml > <head> > <title>Test2</title> > .... > </head> > > n.xml > 1.xml > <head> > <title>Test nth</title> > .... > </head> Many others have asked this before. The official anwer is that you cant just concatenate files because XML data is allowed to have one root element only. Some parsers seem to tolerate XML files that consist of a sequence of XML root elements. But remember that these files are not well- formed XML files anymore, although the look so. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
