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.
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
Post a Comment