This should be able to get the maximum temperatures for you, you would just have to change the where filter to get the minimums
using System.Xml.Linq; \\... XDocument xmlDoc = XDocument.Load("YourXml.xml"); var maximums = from tempvalue in xmlDoc.Descendants("temperature").Elements("value") where tempvalue.Parent.Attribute("type").Value == "maximum" select (string)tempvalue; List<string> returnme = maximums.ToList<string>(); return returnme;
Hope this help.
Note: I'm a bit rusty with my Linq to Xml in C# so it may not be the most elegant solution.
You'll probably need to parse the xml you get back with xpath to pull out the data you want. There's a brief example here.
Alternatively you could create a class structure that mirrors the xml structure and use the XmlSerializer to deserialize the xml into objects, but that's probably more trouble than it's worth in this case.
- Parsing XML from the National Weather Service SOAP Service in C# LINQ to XML
- creating Linq to sqlite dbml from DbLinq source code
- c# Linq or code to extract groups from a single list of source data
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- Parsing SOAP response with LINQ to XML - how to get nested nodes under parent?
- How to pass LinQ Expressions from F# to C# code
- Using LINQ to delete an element from a ObservableCollection Source
- How do I preserve whitespace characters when parsing XML from C# LINQ
- Return Count from Netflix oData Service When the LINQ Count() Method Doesn't Work
- How does linq actually execute the code to retrieve data from the data source?
- LINQ Source Code Available
- Returning datasets from LINQ to SQL in a REST/WCF service
- Is there a bug in this code from 101 LINQ Samples on MSDN? (Update: Fixed)
- .NET service OData return anonymous type from LINQ query
- C# LINQ How to get a data source from a db?
- Can't add a new record with an integer value into database by using linq from code C#
- parsing xsd from WSDL using LINQ to XML
- source code for LINQ 101 samples
- Parsing a string from a textfile and using LINQ
- Linq code to get the index of an object in an array from an object within a list
- Include null cells in Linq query from DB in C# code
- Getting the time difference using LINQ from a list of TimeSpans and parsing the time in as only minutes and seconds
- How to reinsert data from one table onto itself using LINQ in code migration?
- want to get data from specific column of azure mobile service table using linq
- C# return linq result as a list from a wcf service method then use it in aspx web forms page
- Convert the code from Foreach loop to Linq
- LINQ example code from microsoft...
- Construct a list of wpf Hyperlink elements from an XML source file using Linq
- C# LINQ or for loop How to get a data source from a db?
- c# LINQ where with nullable boolean fields
- Can Not Convert From Expression<Func<T, decimal>> To Func<T, decimal> In Sum Method in Lambda Expression
- LINQ query to filter items inside a list of list
- Unable to get proper entity value
- Make access possible to dynamic table LINQ EF6 Code First
- How to handle c# exceptions in PLINQ query on EnumeratFiles or EnumeratFolders
- extract id attributes strings
- Linq query to join two objects and calculate sum
- Lambdaexpression of Linq-query in a variable
- Convert Query to Lambda Expression
- how to perform sorting operation for a grid view using linq,?
- C# Linq Conditional Cast object to EF table Type
- The type 'System.Data.Linq.Binary' is not supported in aggregation operations - LINQ
- Roll up totals of an ObservableCollection<MyType> with a Linq expression
- How to add dynamic sort by direction to NHibernate queryover
- how to LINQ query show repeated records That 2 or less than twice repeated
- LINQ - Limit result based on count returned by custom function
- Order by user and then select max date
- In Linq, what is the opposite of .Select()?
- Controller action not grabbing file from view when attempting to upload