Ler XML ASP
Prezados,
boa noite. Estou precisando de um help!
possuo um script que retorna o seguinte XML:
<tns:phpsysinfo xmlns:tns="http://phpsysinfo.sourceforge.net/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://phpsysinfo.sourceforge.net/ phpsysinfo3.xsd">
<Generation version="3.3.0" timestamp="1554324372"/>
<Options tempFormat="c" byteFormat="auto_binary" datetimeFormat="utc" refresh="60000" threshold="90"/>
<Vitals Hostname="WIN" IPAddr="127.0.0.1" Kernel="6.1.7600 (64-bit)" Distro="Microsoft Windows Server 2008 R2 Enterprise" Distroicon="WinVista.png" Uptime="204091" Users="0" LoadAvg="" CPULoad="0" SysLang="Portuguese - Brazil (1046)" CodePage="windows-1252" Processes="56" OS="WINNT"/><Network/>
<Hardware Name="VMware, Inc. VMware Virtual Platform">
<PCI>
<Device Name="PCI standard PCI-to-PCI bridge" Count="2"/>
<Device Name="PCI Express standard Root Port" Count="32"/>
<Device Name="Standard AHCI 1.0 Serial ATA Controller" Manufacturer="Standard AHCI 1.0 Serial ATA Controller"/>
<Device Name="Intel(R) PRO/1000 MT Network Connection" Manufacturer="Intel"/>
<Device Name="Intel(R) PRO/1000 MT Network Connection #2" Manufacturer="Intel"/>
<Device Name="Intel(R) PRO/1000 MT Network Connection #3" Manufacturer="Intel"/>
<Device Name="LSI Adapter, SAS 3000 series, 8-port with 1068" Manufacturer="LSI"/>
<Device Name="Intel 82371AB/EB PCI to ISA bridge (ISA mode)" Manufacturer="Intel"/>
<Device Name="VMware SVGA 3D" Manufacturer="VMware, Inc."/>
<Device Name="Intel(R) 82371AB/EB PCI Bus Master IDE Controller" Manufacturer="Intel"/>
<Device Name="VMware VMCI Bus Device" Manufacturer="VMware, Inc."/>
<Device Name="Intel 82443BX Pentium(R) II Processor to PCI Bridge" Manufacturer="Intel"/>
</PCI>
<IDE>
<Device Name="NECVMWar VMware SATA CD00 ATA Device"/>
</IDE>
<SCSI>
<Device Name="VMware Virtual disk SCSI Disk Device" Capacity="128849011200"/>
</SCSI>
<CPU>
<CpuCore Model="Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz" CpuSpeed="3400" Cache="0"/>
<CpuCore Model="Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz" CpuSpeed="3400" Cache="0"/>
<CpuCore Model="Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz" CpuSpeed="3400" Cache="0"/>
<CpuCore Model="Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz" CpuSpeed="3400" Cache="0"/>
</CPU>
</Hardware>
<Memory Free="1720385536" Used="2574114816" Total="4294500352" Percent="60">
<Swap Free="3048210432" Used="685768704" Total="3733979136" Percent="18">
<Mount MountPointID="1" FSType="swap" Name="SWAP" Free="3048210432" Used="685768704" Total="3733979136" Percent="18" MountPoint="C:\pagefile.sys"/>
</Swap>
</Memory>
<FileSystem>
<Mount MountPointID="1" FSType="" Name="Removable Disk (3 1/2 in.)" Free="0" Used="0" Total="0" Percent="0" MountPoint="A:"/>
<Mount MountPointID="2" FSType="NTFS" Name="Local Disk" Free="732983296" Used="128009076736" Total="128742060032" Percent="99" MountPoint="C:"/>
<Mount MountPointID="3" FSType="" Name="Compact Disc" Free="0" Used="0" Total="0" Percent="0" MountPoint="D:"/>
</FileSystem><MBInfo/>
<UPSInfo/>
<Plugins/>
<Errors/>
</tns:phpsysinfo>
tenho o seguinte código em ASP:
<%
url_server = "http://127.0.0.1/xml.php?plugin=complete"
Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
Call xmlhttp.open("GET", url_server, false)
Call xmlhttp.send()
strRetorno = xmlhttp.responseText
Set oXmlDom = Server.CreateObject("Msxml2.DOMDocument.3.0")
oXmlDom.loadXML strRetorno
Set oNodes = oXmlDom.selectNodes("tns:phpsysinfo/FileSystem/Mount")
for each oNode in oNodes
response.write "Cache " & oNode.selectSingleNode("Percent").Text
next
Set oXmlDom = Nothing
%>
ao tentar trazer alguns valores, sempre me retorna o seguinte erro:
Erro de tempo de execução do Microsoft VBScript erro '800a01a8'
Objeto necessário: 'oNode.selectSingleNode(...)'
Preciso trazer os valores de:
CPU
Memory
HD
Alguém teria alguma dica de como consigo resolver?
Agradeço a atenção de todos.
Discussão (0)
Carregando comentários...