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

linq to xml not returning any results possible namespace issue?

Here are the first few lines of my XML document:
Free2Rhyme2k
  • 534
  • 1
  • 6
  • 15
0
votes
1 answer

Transform Binary to XML in OutSequence from WCF Service Proxy in WSO2 ESB

I'm using a proxy service in WSO2 ESB in between a REST api and a WCF Service. The WCF service that I am calling accepts and returns an XElement object. When the response of the WCF service enters the out sequence of the proxy the result is in…
drewfrisk
  • 451
  • 7
  • 17
0
votes
1 answer

Select from XElement with where statement using linq

I have and XElement object that was built up from an XML looking like this: Account Manager Company name Boston
0
votes
2 answers

Deserializing using XElement

I had to write my own deserializer, because XmlSerializer and DataContractSerializer aren't good for my needs. So, here's the base of my deserializer: static BaseElement ParseXml(XElement element) { var e =…
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
0
votes
1 answer

XElement add style

Im trying to have a XElement with style like: so im doing this: XElement root = new XElement("g"); root.SetAttributeValue("style", from attributes in Child.Attributes where…
user1977936
  • 31
  • 2
  • 13
0
votes
2 answers

How to convert XML to Xelement?

string queryText = string.Format(@" 3
0
votes
2 answers

How to bind data from XElement to combobox

XElement Doc.
1361 TEST3
1658 TEST4
1975 Mac New Patient
2209
Jay
  • 15
  • 7
0
votes
3 answers

Add attribute without name and value?

Whether XML element attribute name can be empty: I am getting an exception I cant to load this. Is this…
Aravind Srinivas
  • 251
  • 3
  • 8
  • 15
0
votes
1 answer

Wildcard Search in XElement

I am using XElement to search a XML document that a user selects through openfiledialog. Here is the code: private void dothis() { string query; XElement xml = XElement.Load(path); XNamespace ns =…
0
votes
2 answers

Convert flat text file to XML in C#

I have a .txt file and I have to change it in xml file. My .txt file is pipe-delimited ("|", vertical bar) flat text file. Like this: 169055|759656025621|Dos|Justamente Tres|Kill Rock Stars|256|PUNK|CD-JEWEL CASE|06/24/1996|D Now I have to change…
user1570958
0
votes
1 answer

How to create object from an xml

How do you create an object by XElement? I can create a list, but I want a single object and not a list. Here is my code: XElement elem = XElement.Load(path); var myList = from n in elem.Descendants("NodeNumber1") select new …
Hodaya Shalom
  • 4,327
  • 12
  • 57
  • 111
0
votes
2 answers

Why can I not use an XPath on XML data with namespace?

I'm using the following code: string testingXML = ""; var xmlReader = XmlReader.Create( new StringReader(testingXML) ); …
Kyle
  • 17,317
  • 32
  • 140
  • 246
0
votes
2 answers

How to retrieve HTML from XElement without parent tag?

I have xml like this XElement xe = " Text with link Test "; public static string GetHtmlFromXElement(this XElement xe) { return xe.ToString(); } If I use string result =…
podeig
  • 2,597
  • 8
  • 36
  • 60
0
votes
1 answer

Can I create an xml file at a specified location using XElement?

My windows application is creating a xml file and adding data to it using XElement. Is there any way i can create this file in D:/ directly rather than the project bin folder(default). I want a web service to access this xml file to perform some…
user2038650
  • 73
  • 1
  • 10
0
votes
2 answers

How to iterate through XElement Nodes of XDocument and add to another XElelement?

I have a XML document that looks like this: LastName1 FirstName1 MiddleName1 Originally I had a method to create this structure like below: public…
atconway
  • 20,624
  • 30
  • 159
  • 229