Questions tagged [linq-to-xml]

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

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

Related Links

5019 questions
1
vote
1 answer
1
vote
2 answers

How to replace xmlns inside xml with C#

I tried to replace xmlns version (any version) with version http://schemas.telerik.com/reporting/2012/3.6. inside C# project This what I get as input.
Simo
  • 23
  • 6
1
vote
1 answer
1
vote
2 answers

Dynamic Linq to Xml example

I need a basic example on how to use System.Linq.Dynamic with Xml. Here’s a functioning statement I want to convert to dynamic Linq: XElement e = XElement.Load(new XmlNodeReader(XmlDoc)); var results = from r in…
Jack Straw
  • 11
  • 1
  • 3
1
vote
1 answer

c# Don't as new XElement when element before is null

I'm trying to generate XML from code : //// Group the rows by Department (all 123A in your question). var departments = dt.AsEnumerable().GroupBy(r => r.Field("ID")); // Generate the root element var…
RemuRemue
  • 13
  • 2
1
vote
1 answer

Implementing Database in WP7 Mango

I had many doubts regarding Database in windows Phone Mango. In WP7 mango how i can enter/Insert a list of objects or observable collection to a table I had a database (*.sdf) with me that contains some data, I used SQLMetel and i created a .cs…
Stephan Ronald
  • 1,395
  • 2
  • 14
  • 39
1
vote
1 answer

Adding element to XML using linq to XML

i have this piece of code which i use to add some elements: string xmlTarget = string.Format(@"", new object[] { target.Name, target.Type,…
Stacker
  • 8,157
  • 18
  • 73
  • 135
1
vote
4 answers

XDocument null reference on object that isnt null

I have an xml (called xdoc) file like the following: if i do the following XElement xel = xdoc.Element("ItemContainer"); As far as i understand, i should get back a…
richzilla
  • 40,440
  • 14
  • 56
  • 86
1
vote
3 answers

How to make nested list from same level elements, based on start-text

I'm trying to a make nested list based on list-item's (same level), but having different label text, which will start-text of each list-item. I have done with some regex replaces to meet the nesting. I assume my code is not up to mark to meet the…
Rudramuni TP
  • 1,268
  • 2
  • 16
  • 26
1
vote
1 answer

ID Sequencing Elements based on attribute value

Please suggest to generate IDs of 'fig type="float"' type elements. Place the text() node in new element by name 'caption'. Unable to group ELEMENT + ATTRIBUTE content. Input XML:
The j…
Rudramuni TP
  • 1,268
  • 2
  • 16
  • 26
1
vote
1 answer

How to access the properties on a XML Node via linq?

I read through this post. I have this XML: This is what i tried, but with no luck: var xml =…
Willem
  • 9,166
  • 17
  • 68
  • 92
1
vote
4 answers

Why this LINQ to XML doesn't work?

I receive this XML from an external source: Command completed successfully; no messages TEST-12345
Saeed Neamati
  • 35,341
  • 41
  • 136
  • 188
1
vote
1 answer

Handling linq XML queries that do not return an element (and thus throw an exception)

I am writing a linq query to return an IEnumerable of XElements that match the search criteria. The program throws an exception when an element matching the search criteria isn't found and including the statement inside a try/catch block doesn't…
1
vote
1 answer

Finding standard deviation/variance in data values

So this is quite a complex problem and I googled alot about it but haven't really come up with anything. So the problem, I need to find the Standard Deviation of some variables within files. So let me state what I need to do: I have the code to find…
user933467
1
vote
1 answer

Linq to XML sorting/orderby issue by sorting on subelements

I've got an XML file where a part of it are the GoodsItems element. I want to order the GoodsItem elements so that the ones having a subelement SupplementaryInformationLines.SupplementaryInformationLine with Code == "X002" and Text != "NLR" comes…
Trygve
  • 2,445
  • 1
  • 19
  • 23
1 2 3
99
100