Creating XML in C #

Currently, I need to create and update large xml files. So what is the best C # xml parser for creating or updating xml files? I heard about LINQ in C #, can this be used?

+4
source share
3 answers

For really large documents, you can use the simple XmlReader / XmlWriter pipelining approach, as this avoids loading the entire file into memory, which is the case with both the XmlDocument DOM and LINQ to SQL.

+6
source

LINQ's LINQ capabilities for querying and working with large / complex data files are pretty good, and yet XElement usually has better performance than XmlDocument objects. Working through XElements also simplifies some of the traditional efforts and verbosity of traditional XML processing, especially namespaces are much easier to handle.

Linq's MSDN Link to XML: http://msdn.microsoft.com/en-us/library/bb387098.aspx

+4
source

You can use SAX to parse large xml files; and XDocument for supporting XML file.

0
source

Source: https://habr.com/ru/post/1306664/


All Articles