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
0
votes
1 answer

C# Validate Xdocument File

I need to validate a selected Xml file using Xdocument without Xsd. I have a file named "Cheker" and the file to check. for example i need to compare the hierarchy ,and how much elements by name from the checker file. if i have in the "checker" file…
0
votes
2 answers

Parsing XML excluding elements

I'm trying to parse a xml file, which isn't the problem. But my xml file has multiple tags. One is for a song, and the other one is for an artist. I want to exclude the artist name tag, but I can't figure out how. Here's my code so far: …
user4189129
0
votes
1 answer

Adding multiple xElements at once using LINQ to XML

I have below custom class: Public Class Frame #Region " Enumerations " Public Enum FrameResult Success Failed End Enum #End Region #Region " Private Members " Private _timeStamp As Date Private _content As…
Willy
  • 9,848
  • 22
  • 141
  • 284
0
votes
1 answer

Creating XElement object

I am trying to create a dynamic xelement. I want the output in Xelement as : text1 text2 So, I wrote code as : string[] arr = new string[2]; arr[0] = "text1"; arr[1] = "text2"; XElement…
demo stack
  • 103
  • 1
  • 1
  • 7
0
votes
0 answers

XElement.Parse(xml) not working in Release Config on Windows 10 Mobile

I am new to developing for Microsoft's UWP platform after developing for 2 years on Silverlight. I have started working on a project to get XML from a website and parse it to display it inside a Windows UWP app. The code that I use works fine in the…
0
votes
3 answers

Getting the root element of xml file in linq

I am using linq. Here is my document structure: 7 0 0 Ron/INT-0014
tahasozgen
  • 469
  • 5
  • 27
0
votes
1 answer

How to retrieve values by index from a dynamic Object

String zohoResponse = @" [ { 'Title':'Mr.', 'First Name':'ram', 'Last Name':'chang', 'Employed at Trade Client Name':'mile travel', 'Telephone':'657498333', …
kimmie
  • 21
  • 8
0
votes
2 answers

Using LINQ to retrieve value from XML (Multiple selection)

I'm trying to convert this VB.Net LINQ to C# LINQ. Basically, what the end solution is trying to achieve is to to take in an XML file; see snippet: Trial 1326.85575 992.409
Hexie
  • 3,955
  • 6
  • 32
  • 55
0
votes
1 answer

ReplaceWith XElement

Below is the snippet of content of my XDocument .

1 point: correct response of Point X: …

Chat
  • 185
  • 1
  • 5
  • 15
0
votes
1 answer

Relization of XElement, XAttribute + IDataErrorInfo for binding in wpf app

I use mvvm pattern in wpf app. As datasource i've XDocument. In UI i bind controls to XElements and XAttribute's values from this XDocument. f.ex. It allows me to have data in…
vitm
  • 473
  • 1
  • 3
  • 12
0
votes
1 answer

Check Xelement style in OpenXml

I am copy all the content from OpenXml word file to another OpenXml word file. But during the copy I want to make some changes depending on the style. for Examlpe if the text inside of some paragraph is red I will change it to blue. How to I get the…
Jordan
  • 570
  • 1
  • 6
  • 24
0
votes
2 answers

Add attributes with XElement

I have a file xml like this: I need to add some attributes in the nodes For example:
Ravo86
  • 55
  • 5
0
votes
1 answer

Search through XDocument for XElement with certain Attribute using Linq

I have a XML document that looks like this:
Misa Kovar
  • 63
  • 2
  • 7
0
votes
4 answers

How to remove a specific XElement between XElements that contains a specific element value

Xdocument Xd (mapped from xml file): advanced wanip
Giannis Grivas
  • 3,374
  • 1
  • 18
  • 38