I have this problem to programming it. For each specific port element I want check if <script>
exixst. The <script>
is a child of <port>
node element. Take this example, here's a link to the image:
https://i.stack.imgur.com/T2FGr.png
// Leggi il file xml
XDocument xml = XDocument.Load(pathFile.Text);
var hosts = from h in xml.Descendants("address")
select new
{
addr = h.Attribute("addr").Value,
addrtype = h.Attribute("addrtype").Value
};
foreach (var host in hosts)
{
if (host.addrtype == "ipv4")
{
console.Text += host.addr + Environment.NewLine;
console.Text += host.addrtype + Environment.NewLine;
var ports = xml.Descendants("port");
foreach (var port in ports)
{
var script = port.Element("script");
var hasScriptElement = script != null;
?? -> how can i get the elem pem key value? thanks!!
}
}
}