I have a XML file like this:
<SoftwareComponent schemaVersion="1.0" packageID="Y75WC" releaseID="Y75WC" hashMD5="a190fdfa292276288df38507ea551a3b" path="FOLDER04650736M/1/OptiPlex_3050_1.7.9.exe" dateTime="2017-12-05T05:34:30+00:00" releaseDate="décembre 05, 2017" vendorVersion="1.7.9" dellVersion="1.7.9" packageType="LWXP" identifier="532f5a9e-c087-4499-b40c-cf7921ee06d3" rebootRequired="true">
<Name>
<Display lang="en"><![CDATA[Dell OptiPlex 3050 System BIOS,1.7.9]]></Display>
</Name>
<ComponentType value="BIOS">
<Display lang="en"><![CDATA[BIOS]]></Display>
</ComponentType>
<Description>
<Display lang="en"><![CDATA[This package provides the Dell System BIOS update and is supported on Dell OptiPlex 3050 Tower, OptiPlex 3050 Small Form Factor and OptiPlex 3050 Micro for Windows Operation System.]]></Display>
</Description>
<LUCategory value="NONE">
<Display lang="en"><![CDATA[None]]></Display>
</LUCategory>
<Category value="BI">
<Display lang="en"><![CDATA[FlashBIOS Updates]]></Display>
</Category>
<SupportedDevices>
<Device componentID="159" embedded="0">
<Display lang="en"><![CDATA[OptiPlex 3050 System BIOS]]></Display>
</Device>
</SupportedDevices>
<SupportedSystems>
<Brand key="1" prefix="OP">
<Display lang="en"><![CDATA[Optiplex]]></Display>
<Model systemID="07A3">
<Display lang="en"><![CDATA[3050]]></Display>
</Model>
</Brand>
</SupportedSystems>
<ImportantInfo URL="http://www.dell.com/support/home/us/en/19/Drivers/DriversDetails?driverId=Y75WC" />
<Criticality value="2">
<Display lang="en"><![CDATA[Urgent-Dell highly recommends applying this update as soon as possible. The update contains changes to improve the reliability and availability of your Dell system.]]></Display>
</Criticality>
There are multiple SoftwareComponent Elements inside.
I tried to get some attributes of SoftwareComponent ( dellVersion, hashMD5) based on descendants Elements ( ComponentType value, SupportedSystems->Device->Display value, Criticality value) but all my tests were not good.
See my actual code, I can get all the value in the XML file only:
XDocument doc = XDocument.Load("catalog.xml");
var els = from el in doc.Root.Elements("SoftwareComponent")
select new
{
dellVersion = (string)el.Attribute("dellVersion"),
hashMD5 = (string)el.Attribute("hashMD5"),
path = (string)el.Attribute("path"),
};
foreach (var el in els)
{
Console.WriteLine("dell BIOS: {0}, MD5: {1}, path: {2}", el.dellVersion, el.hashMD5, el.path);
}
Somebody can show me how to proceed please ?
Thanks