Monday 15 April 2013

c# - Get child node values at XElement -


I try to get the value of XElement's child nodes using C #. The XElement block is below My aim is to get the value on the 'c0' node How can I do this?

  // Client Orion SDK (SVIS) client is I XElement xe = client.QueryXml ("Choose Orion with Orion. Polars where NetObjectID = 15", tap);   

Excelment results block:

  & lt; QueryResult xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://schemas.solarwinds.com/2007/08/informationservice" & gt; & Lt; Templates & gt; & Lt; Resultset & gt; & Lt; Column name = "Uri" type = "string" serial = "0" /> & Lt; / Resultset & gt; & Lt; / Template & gt; & Lt; Data & gt; & Lt; Line & gt; & Lt; C0> SWIS: //solarwinds./Orion/Orion.Pollers/PollerID=55< / C0> & Lt; / Row & gt; & Lt; Line & gt; & Lt; C0> SWIS: //solarwinds./Orion/Orion.Pollers/PollerID=56< / C0> & Lt; / Row & gt; & Lt; Line & gt; & Lt; C0> SWIS: //solarwinds./Orion/Orion.Pollers/PollerID=57< / C0> & Lt; / Row & gt; & Lt; Line & gt; & Lt; C0> SWIS: //solarwinds./Orion/Orion.Pollers/PollerID=58< / C0> & Lt; / Row & gt; & Lt; / Data & gt; & Lt; / QueryResult & gt;    

I got the solution below the code block.

  XElement xe = client.QueryXml ("Select URI to Uri. Polars where NetObjectID = 15", blank); IList & LT; XElement & gt; Indexed Elements = xe.Elements (). ToList (); (Excelment) in xe.Elements (). Item (). ToList () [1]) Elements (). ToList ()) {try {// //item.Value} to do something (hold exc) {throw exc; }}    

No comments:

Post a Comment