I am trying to get ALL attributes from "server" below:
This is the XML file(partial):
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<server xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="udsServerInfo.xsd" id="57672acc-4ba7-4876-811a-1629eca853ed" productPath="C:\Tools\UDS\udsServerInfo\" osActivated="true">
<networkAdapters>
Here is the code which returns NULL for "server":
var server = (from node in doc.Attributes("server")
select node);
I am able to get all networkAdapters by calling doc.Descendants("networkAdapter") but haven't figured out how to obtain the attributes .
Thank you
Anonymous User
10-Dec-2013Try this (assuming doc is an XDocument):