Top "Linq-to-xml" questions

LINQ-to-XML provides a SQL-like query experience for navigating, parsing, and aggregating data stored in XML documents.

XPath and XPathSelectElement

I have the following xml <root> <databases> <db1 name="Name1" /> <db2 name="Name2" …

c# .net xml xpath linq-to-xml
C# Distinct on IEnumerable<T> with custom IEqualityComparer

Here's what I'm trying to do. I'm querying an XML file using LINQ to XML, which gives me an IEnumerable&…

c# linq-to-xml ienumerable distinct
What is the difference between Linq to XML Descendants and Elements

I have came across both these keywords in the VS IntelliSense. I tried to googling the difference between them and …

c# .net xml linq-to-xml
How to print <?xml version="1.0"?> using XDocument

Is there any way to have an XDocument print the xml version when using the ToString method? Have it output …

c# xml linq-to-xml
XML parse check if attribute exist

I've made a method which checks if an attribute exist in a XML-file. If it does not exist it returns "…

c# xml linq linq-to-xml
Linq to Xml : Exception -The ' ' character, hexadecimal value 0x20, cannot be included in a name

This is my Entity Class with an Entity : [Table(Name = "CLINICAL_ITEM_MASTER")] public class ClinicalItemMaster { [Column] public int CLIENT_…

.net linq entity-framework linq-to-xml
XDocument: saving XML to file without BOM

I'm generating an utf-8 XML file using XDocument. XDocument xml_document = new XDocument( new XDeclaration("1.0", "utf-8", null), new XElement(ROOT_…

c# linq-to-xml byte-order-mark
How to convert XmlNode into XElement?

I have an old XmlNode-based code. but the simplest way to solve my current task is to use XElement and …

c# .net linq linq-to-xml
XDocument to XElement

How do you convert an XDocument to an XElement? I found the following by searching, but it's for converting between …

c# xml linq-to-xml xelement
LINQ and XDocument: How to create XML file?

I have a three List in c# ,the variable names are l_lstData1, l_lstData2, l_lstData3. File structure is &…

c# xml linq linq-to-xml