Top "Linq-to-xml" questions

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

how to use XPath with XDocument?

There is a similar question, but it seems that the solution didn't work out in my case: Weirdness with XDocument, …

c# .net xml xpath linq-to-xml
How to select a specific node with LINQ-to-XML

I can select the first customer node and change its company name with the code below. But how do I …

c# linq-to-xml
How to put attributes via XElement

I have this code: XElement EcnAdminConf = new XElement("Type", new XElement("Connections", new XElement("Conn"), // Conn.SetAttributeValue("Server", comboBox1.Text); // …

c# xml linq-to-xml
XML file creation using XDocument in C#

I have a List<string> "sampleList" which contains Data1 Data2 Data3... The file structure is like <file&…

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

I have an xml file that contains its element like <ab:test>Str</ab:test> When …

c# xml linq linq-to-xml
How to get Xml as string from XDocument?

I am new to LINQ to XML. After you have built XDocument, how do you get the OuterXml of it …

c# .net xml string linq-to-xml
How to prevent System.Xml.XmlException: Invalid character in the given encoding

I have a Windows desktop app written in C# that loops through a bunch of XML files stored on disk …

c# xml linq-to-xml
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary

I receive the above error message when performing a unit test on a method. I know where the problem is …

c# linq-to-sql linq-to-xml idictionary
Convert XElement to string

I have a simple XElement object XElement xml = new XElement("XML", new XElement ("TOKEN",Session["Token"]), new XElement("ALL_INCLUSIVE", "0"), …

c# xml linq linq-to-xml
get xelement attribute value

I have an XElement that looks like this: <User ID="11" Name="Juan Diaz" LoginName="DN1\jdiaz" xmlns="http://schemas.…

c# xml linq-to-xml xelement