c# - Enumerating Linq.Xelement -
RESPONSE is no more string, but how to adjust this code to work on Linq.Xelement?
string response = "any XML data"; XmlDocument xmlDocument = Load XML Document (feedback); XmlNodeList nodelist = xmlDocument.GetElementsByTagName ("fql_query_response"); If (node list! = Null and node list, calculation & gt;) (if (node list [0]. Childnodes) {XmlNodeList result = xmlDocument.GetElementsByTagName ("event_member"); dictionary & lt; string, eventUser & gt; EventUserDict = New Dictionary & lt; String, EventUser & gt; (); Forresh (XML in Consequence node) {myuids.Add (Int64.Parse (node. First Child.Intext))}}
You can use XElement.ToString ()
XElement
to create an XML string that you can write in your XmlDocument
Can load:
XmlDocument xmlDocument = LoadXMLDocument (yourXElement.ToString ());
Comments
Post a Comment