哪位高手给指导一下Xml读取字段的例子[已解决]
本帖最后由 eaglelin 于 2012-3-14 16:13 编辑<WIM>
<TOTALBYTES>2283831212</TOTALBYTES>
<IMAGE INDEX="1">
<DIRCOUNT>9612</DIRCOUNT>
<FILECOUNT>48586</FILECOUNT>
<TOTALBYTES>8119970326</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x01CB8901</HIGHPART>
<LOWPART>0xEF63352E</LOWPART>
</CREATIONTIME>
<LASTMODIFICATIONTIME>
<HIGHPART>0x01CBF8E7</HIGHPART>
<LOWPART>0x6CD133C5</LOWPART>
</LASTMODIFICATIONTIME>
<WINDOWS>
<ARCH>0</ARCH>
<PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
<EDITIONID>Starter</EDITIONID>
<INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
<HAL>acpiapic</HAL>
<PRODUCTTYPE>WinNT</PRODUCTTYPE>
<PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
<LANGUAGES>
<LANGUAGE>zh-CN</LANGUAGE>
<DEFAULT>zh-CN</DEFAULT>
</LANGUAGES>
<VERSION>
<MAJOR>6</MAJOR>
<MINOR>1</MINOR>
<BUILD>7601</BUILD>
<SPBUILD>17514</SPBUILD>
<SPLEVEL>1</SPLEVEL>
</VERSION>
<SYSTEMROOT>WINDOWS</SYSTEMROOT>
</WINDOWS>
<NAME>Windows 7 STARTER</NAME>
<DESCRIPTION>Windows 7 STARTER</DESCRIPTION>
<FLAGS>Starter</FLAGS>
<HARDLINKBYTES>3016164054</HARDLINKBYTES>
<DISPLAYNAME>Windows 7 简易版</DISPLAYNAME>
<DISPLAYDESCRIPTION>Windows 7 简易版</DISPLAYDESCRIPTION>
</IMAGE>
<IMAGE INDEX="2">
<DIRCOUNT>9623</DIRCOUNT>
<FILECOUNT>48674</FILECOUNT>
<TOTALBYTES>8140142765</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x01CB8901</HIGHPART>
<LOWPART>0xEF63352E</LOWPART>
</CREATIONTIME>
<LASTMODIFICATIONTIME>
<HIGHPART>0x01CBF8E7</HIGHPART>
<LOWPART>0x85E832E1</LOWPART>
</LASTMODIFICATIONTIME>
<WINDOWS>
<ARCH>0</ARCH>
<PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
<EDITIONID>HomeBasic</EDITIONID>
<INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
<HAL>acpiapic</HAL>
<PRODUCTTYPE>WinNT</PRODUCTTYPE>
<PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
<LANGUAGES>
<LANGUAGE>zh-CN</LANGUAGE>
<DEFAULT>zh-CN</DEFAULT>
</LANGUAGES>
<VERSION>
<MAJOR>6</MAJOR>
<MINOR>1</MINOR>
<BUILD>7601</BUILD>
<SPBUILD>17514</SPBUILD>
<SPLEVEL>1</SPLEVEL>
</VERSION>
<SYSTEMROOT>WINDOWS</SYSTEMROOT>
</WINDOWS>
<NAME>Windows 7 HOMEBASIC</NAME>
<DESCRIPTION>Windows 7 HOMEBASIC</DESCRIPTION>
<FLAGS>HomeBasic</FLAGS>
<HARDLINKBYTES>3031390386</HARDLINKBYTES>
<DISPLAYNAME>Windows 7 家庭普通版</DISPLAYNAME>
<DISPLAYDESCRIPTION>Windows 7 家庭普通版</DISPLAYDESCRIPTION>
</IMAGE>
<IMAGE INDEX="3">
<DIRCOUNT>9841</DIRCOUNT>
<FILECOUNT>49687</FILECOUNT>
<TOTALBYTES>8581939355</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x01CB8901</HIGHPART>
<LOWPART>0xEF63352E</LOWPART>
</CREATIONTIME>
<LASTMODIFICATIONTIME>
<HIGHPART>0x01CBF8E7</HIGHPART>
<LOWPART>0x98F3DBD3</LOWPART>
</LASTMODIFICATIONTIME>
<WINDOWS>
<ARCH>0</ARCH>
<PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
<EDITIONID>HomePremium</EDITIONID>
<INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
<HAL>acpiapic</HAL>
<PRODUCTTYPE>WinNT</PRODUCTTYPE>
<PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
<LANGUAGES>
<LANGUAGE>zh-CN</LANGUAGE>
<DEFAULT>zh-CN</DEFAULT>
</LANGUAGES>
<VERSION>
<MAJOR>6</MAJOR>
<MINOR>1</MINOR>
<BUILD>7601</BUILD>
<SPBUILD>17514</SPBUILD>
<SPLEVEL>1</SPLEVEL>
</VERSION>
<SYSTEMROOT>WINDOWS</SYSTEMROOT>
</WINDOWS>
<NAME>Windows 7 HOMEPREMIUM</NAME>
<DESCRIPTION>Windows 7 HOMEPREMIUM</DESCRIPTION>
<FLAGS>HomePremium</FLAGS>
<HARDLINKBYTES>3410651416</HARDLINKBYTES>
<DISPLAYNAME>Windows 7 家庭高级版</DISPLAYNAME>
<DISPLAYDESCRIPTION>Windows 7 家庭高级版</DISPLAYDESCRIPTION>
</IMAGE>
<IMAGE INDEX="4">
<DIRCOUNT>9899</DIRCOUNT>
<FILECOUNT>50152</FILECOUNT>
<TOTALBYTES>8463989395</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x01CB8901</HIGHPART>
<LOWPART>0xEF63352E</LOWPART>
</CREATIONTIME>
<LASTMODIFICATIONTIME>
<HIGHPART>0x01CBF8E7</HIGHPART>
<LOWPART>0xB3AC1675</LOWPART>
</LASTMODIFICATIONTIME>
<WINDOWS>
<ARCH>0</ARCH>
<PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
<EDITIONID>Professional</EDITIONID>
<INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
<HAL>acpiapic</HAL>
<PRODUCTTYPE>WinNT</PRODUCTTYPE>
<PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
<LANGUAGES>
<LANGUAGE>zh-CN</LANGUAGE>
<DEFAULT>zh-CN</DEFAULT>
</LANGUAGES>
<VERSION>
<MAJOR>6</MAJOR>
<MINOR>1</MINOR>
<BUILD>7601</BUILD>
<SPBUILD>17514</SPBUILD>
<SPLEVEL>1</SPLEVEL>
</VERSION>
<SYSTEMROOT>WINDOWS</SYSTEMROOT>
</WINDOWS>
<NAME>Windows 7 PROFESSIONAL</NAME>
<DESCRIPTION>Windows 7 PROFESSIONAL</DESCRIPTION>
<FLAGS>Professional</FLAGS>
<HARDLINKBYTES>3277314427</HARDLINKBYTES>
<DISPLAYNAME>Windows 7 专业版</DISPLAYNAME>
<DISPLAYDESCRIPTION>Windows 7 专业版</DISPLAYDESCRIPTION>
</IMAGE>
<IMAGE INDEX="5">
<DIRCOUNT>9935</DIRCOUNT>
<FILECOUNT>50332</FILECOUNT>
<TOTALBYTES>8624220791</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x01CB8901</HIGHPART>
<LOWPART>0xEF63352E</LOWPART>
</CREATIONTIME>
<LASTMODIFICATIONTIME>
<HIGHPART>0x01CBF8E7</HIGHPART>
<LOWPART>0xCDF1E037</LOWPART>
</LASTMODIFICATIONTIME>
<WINDOWS>
<ARCH>0</ARCH>
<PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
<EDITIONID>Ultimate</EDITIONID>
<INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
<HAL>acpiapic</HAL>
<PRODUCTTYPE>WinNT</PRODUCTTYPE>
<PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
<LANGUAGES>
<LANGUAGE>zh-CN</LANGUAGE>
<DEFAULT>zh-CN</DEFAULT>
</LANGUAGES>
<VERSION>
<MAJOR>6</MAJOR>
<MINOR>1</MINOR>
<BUILD>7601</BUILD>
<SPBUILD>17514</SPBUILD>
<SPLEVEL>1</SPLEVEL>
</VERSION>
<SYSTEMROOT>WINDOWS</SYSTEMROOT>
</WINDOWS>
<NAME>Windows 7 ULTIMATE</NAME>
<DESCRIPTION>Windows 7 ULTIMATE</DESCRIPTION>
<FLAGS>Ultimate</FLAGS>
<HARDLINKBYTES>3435755218</HARDLINKBYTES>
<DISPLAYNAME>Windows 7 旗舰版</DISPLAYNAME>
<DISPLAYDESCRIPTION>Windows 7 旗舰版</DISPLAYDESCRIPTION>
</IMAGE>
<GUID>fa83eecc-c676-48ca-b50d-97b4c766deb0</GUID>
<IMAGECOUNT>5</IMAGECOUNT>
<COMPRESSION>LZX</COMPRESSION>
<PARTNUMBER>1</PARTNUMBER>
<TOTALPARTS>1</TOTALPARTS>
<ATTRIBUTES>0xc</ATTRIBUTES>
</WIM>
哪位高手给指导一下Xml读取字段的例子
用 XMLDomWrapper.au3
#include "_XMLDomWrapper.au3"
_XMLFileOpen(@TempDir&'\1.xml',"")
Local $count= _XMLGetValue ("WIM/IMAGECOUNT")
MsgBox(1,"",$count)
但是读出来的结果不对 http://www.autoitx.com/forum.php?mod=viewthread&tid=634&highlight=xml 自己顶!!!! 本帖最后由 绿色风 于 2012-3-11 21:59 编辑
_XMLFileOpen($xml) ;打开xml文件
$ad = _XMLGetChildText("/WIM/IMAGECOUNT")
MsgBox(0,@error,$ad)
XML 的路径 要注意大小写,根路径中,有的要加 "/" 有的不用加,这应该是个bug.
所有数据取值,基本上返回的是 数组。有时,有的数据需要事先声明。
谢谢了 非常感谢 不错谢谢分享正需要这个~~~ 要好多好多的钱啊啊啊
页:
[1]