I want to extract the NetworkConnection network name (none) in the following xml content:
<ns6:NetworkConnection network="none" needsCustomization="true" xmlns="http://www.vmware.com/vcloud/versions" xmlns:ns2="http://schemas.dmtf.org/ovf/envelope/1" xmlns:ns3="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ns4="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:ns5="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:ns6="http://www.vmware.com/vcloud/v1.5" xmlns:ns7="http://www.vmware.com/schema/ovf" xmlns:ns8="http://schemas.dmtf.org/ovf/environment/1" xmlns:ns9="http://www.vmware.com/vcloud/extension/v1.5">
<ns6:NetworkConnectionIndex>0</ns6:NetworkConnectionIndex>
<ns6:IsConnected>false</ns6:IsConnected>
<ns6:MACAddress>00:50:56:3f:03:5c</ns6:MACAddress>
<ns6:IpAddressAllocationMode>NONE</ns6:IpAddressAllocationMode>
</ns6:NetworkConnection>
I have:
var nsXML = ns.toXml();
var doc = new XML(nsXML);
//default xml namespace = doc.namespace();
var networkName = doc.NetworkConnection.network;;
System.log(networkName);
and am getting null
I dont know how to reference the attribute.