Questions tagged [xelement]

XElement is part of System.Xml.Linq in .NET Framework. This class represents an XML element, the fundamental XML construct.

An XElement has an XName, optionally one or more attributes, and can optionally contain content.

An XElement can contain the following types of content:

  • XElement
  • XComment
  • XProcessingInstruction
  • XText

Reference: XElement Class on MSDN

883 questions
-2
votes
2 answers

How to compare two XElement enumerables?

I have two equal sized lists of XElements: var documentDatabase = XDocument.Parse(xmlDatabase); var rootElementDatabase = documentDatabase.Root; var segmentsDatabase = rootElementDatabase.Descendants("Segment"); var documentSlave =…
Pablo
  • 28,133
  • 34
  • 125
  • 215
-2
votes
2 answers

Adding XElement to XML File

I'm using Linq to XML to add a XElement to my file. In found this solution Adding XElement to XML file using Linq to XML and i doing this similar. MY XML
-2
votes
1 answer

XElement.SetElementValue overwrites elements

I've the following structure: 4 4 4 4 I want to modify some values so I use the following code: XElement root1 = new…
Blaco
  • 9
  • 3
-2
votes
1 answer

Xelement converting special characters to strings

The below XElement converts the special character "&" to "&". XElement newElement = new XElement("testting", "wow&testvalue"); I want it to be the "&" not &.
user2392525
  • 33
  • 1
  • 11
-2
votes
2 answers

Change Xml value with XElement (with specified Attributes)

38 447 Hello, I am looking a…
Romeh
  • 29
  • 8
-2
votes
2 answers

Why is Select not Recognized as a Valid Method of XElement?

Based on the code I see here, my almost-identical code should work: XDocument doc = XDocument.Parse(stringifiedXML); var Platypi = doc.Descendants("Platypus").Select(delItem => new { Name = delItem.Element("duckbillName").Value, Length =…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
-2
votes
1 answer

insert xml string to xml element using LINQ

i want combine two xml that one of them is template and other is data, how can i do this? XML one: XML two:
mahdi yousefi
  • 807
  • 1
  • 9
  • 15
-3
votes
1 answer

What is wrong with this file or code?

What is happening \ what is the difference ? I'm trying to return a specific node from an XML File. XML File:
Pablo Costa
  • 125
  • 4
  • 14
-3
votes
1 answer

Why do non-null XElements cause an NRE?

Why is my extension method GetVendorForXMLElement() erupting in an NRE when I pass it XElements with data? The same code (except for the custom class used, which here is "Vendor") works with other classes/data, but not here. I get an NRE in the…
-3
votes
2 answers

XElement.Load doesn't load the path

I have a path starting with the common C:\Users...\myXmlFile.xml and I am trying to load it with the XElement.Load(@"C:\Users\...\myXmlFile.xml") but it doesn load it and it says: Data at the root level is invalid. Line 1, position 1. I found…
mathinvalidnik
  • 1,566
  • 10
  • 35
  • 57
-3
votes
2 answers

How to get handle to a specific XElement

Consider you have the following xml structure: a.txt 1.5 b.txt 1.0 How can I get a handle to the XElement: 1.0 by…
JavaSa
  • 5,813
  • 16
  • 71
  • 121
-3
votes
1 answer

web browser in C# without using my own web browser class

i have no idea about what im doing the problem is that i got the assignment without any further explanation all what i have to do is make a program with main form that will load an html file into it but without using web browser class and the Html…
m131313
  • 27
  • 1
  • 5
-4
votes
1 answer
1 2 3
58
59