c# - How to read XML using Linq with Nested Descendants -
How to read the elements of nested clan in LINQ
My XML file format Select Descendants ("PpProperties") New {Project in Xmldoc.Descendants ("Project") New {* How to proceed * pre & lt; & Lt; PpProperties & gt; & Lt; Name of the project = "CEESI all 2" date = "2013-11-18T16: 48: 54.9452592 + 01: 00" Revised Date = "2013-11-18T16: 48: 57.2413905 + 01: 00" & gt; & Lt; NuclearSystem & gt; Barium & lt; / NuclearSystem & gt; & Lt; Timeline and gt; & Lt; Clip & gt; & Lt; FilePathFP & gt; FPS \ FP001D \ default-wp000-15Oct2012-105001.vxbin & lt; / FilePathFP & gt; & Lt; / Clips & gt; & Lt; / Time period and gt; & Lt; / Project & gt; & Lt; / PpProperties & gt; & Lt; / SmPpProperties & gt; I am trying to use PpProperties in the form of C # code
var SMPpProperties = xmldoc
var SMPPProperties = xmldoc.Descendants ("project"), filePath = poj.Element (" Timeline ") Choose Element (" Clip "). Element ("FilePathFP") value}. Foreach (var items in SMPpProperties) {Console.WriteLine ("name = {0}, file path = {1}", item.name, item.filePath); }
Comments
Post a Comment