Quantcast
Channel: What is the fastest way to combine two xml files into one - Stack Overflow
Browsing all 12 articles
Browse latest View live

Answer by Eduardo Chávez for What is the fastest way to combine two xml files...

In my case the main solution did not work well, the difference was that I had a List for a thousands of files when I take one element and try to merge with the first element I get OutOfMemory...

View Article



Answer by elhumidio for What is the fastest way to combine two xml files into...

Best solution to me, based on Jose Basilio answer, slightly modified,var combinedUnique = xml1.Descendants() .Union(xml2.Descendants());combinedUnique.First().Save(#fullName)

View Article

Answer by Rudy Hinojosa for What is the fastest way to combine two xml files...

This is the fastest and cleanest way to merge xml files.XElement xFileRoot = XElement.Load(file1.xml);XElement xFileChild = XElement.Load(file2.xml);xFileRoot.Add(xFileChild);xFileRoot.Save(file1.xml);

View Article

Answer by Heba El-Fadly for What is the fastest way to combine two xml files...

var doc= XDocument.Load("file1.xml");var doc1= XDocument.Load("file2.xml");doc.Root.Add(doc2.Root.Elements());

View Article

Answer by Vasu Balakrishnan for What is the fastest way to combine two xml...

If you want to use the XmlDocument, try this var lNode = lDoc1.ImportNode(lDoc2.DocumentElement.FirstChild, true); lDoc1.DocumentElement.AppendChild(lNode);

View Article


Answer by rein for What is the fastest way to combine two xml files into one

Since you asked for the fastest: If (and only if) the xml structure is always consistent: (this is pseudo code)string xml1 = //get xml1 somehowstring xml2 = //get xml2 somehowxml1 = replace(xml1,...

View Article

Answer by Jose Basilio for What is the fastest way to combine two xml files...

The easiest way to do this is using LINQ to XML. You can use either Union or Concat depending on your needs.var xml1 = XDocument.Load("file1.xml");var xml2 = XDocument.Load("file2.xml");//Combine and...

View Article

Answer by VVS for What is the fastest way to combine two xml files into one

If you can guarantee this format you can combine them by doing string manipulation:Read the first file, keep everything before "</AllNodes>"Read the second file, remove the part up to...

View Article


Answer by Tomalak for What is the fastest way to combine two xml files into one

An XSLT transformation could do it:<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:param name="pXml1" select="''" /><xsl:param name="pXml2"...

View Article


Answer by Alan Jackson for What is the fastest way to combine two xml files...

You have two basic options:Parse the xml, combine the data structures, serialize back to xml.If you know the structure, use some basic string manipulation to hack it. For example, in the example above...

View Article

Answer by Sam Schutte for What is the fastest way to combine two xml files...

If I were doing this (using C#), I would create a class that I can deserialize this XML to (you can use xsd.exe to do this), and then loop through all the nodes in the object representing the first...

View Article

What is the fastest way to combine two xml files into one

If I have two string of xml1 and xml2 which both represent xml in the same format. What is the fastest way to combine these together? The format is not important, but I just want to know how can I get...

View Article
Browsing all 12 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>