c# - Extracting field from an XElement -


I have the following information in the XML file () taken from a RestSharp response, and I only care about 5 ID elements I am I want to get these IDs in an array or list.

Enter image details here

How can I remove them Am I

My attempt has been done so far ..

  var root = XElement.Parse (response.Content); Var number_projects_str = Root. First unbreakable value; Int number_of_project = -1; If (int32.TryParse (number_projects_str, number number_of_projects)) {// size_of_product // ...}    

You can use the extension method to select the first cell from each line (which is the ID containing the ID):

  var Ids = root.XPathSelectElements (" / results / Results / rows / row / cell [1] "). Select (o = & gt; (string) o) .oir ();    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -