我正在研究一个 MS Access 项目 (2003),并希望解析网页返回的 XML 代码。它实际上在我们的 Intranet 上。
例如,我想解析https://myLivelinkServer.myEnterprise.com/livelink/livelink.exe?func=search&boolean2=or&where1=something&where1=anything&outputformat=xml
我想将结果放入记录集中。以下是上述页面生成的一些 XML 的示例,其中包含另一个搜索查询(只有 2 个结果):
<?xml version="1.0" encoding="ISO-8859-1"?>
<Output>
<SearchResults>
<SearchResult>
<OTCreatedBy DisplayName="Créé par">
<![CDATA[5063560]]>
</OTCreatedBy>
<OTLocation DisplayName="Emplacement" Protocol="https" ServerName="livelink.myServer.com" URL="/livelink/livelink.exe?func=ll&objId=53080774&objAction=browse">
2000 1237258 10236341 12909408 14593490 40170727 53076463 53076481 53080774 60751603
</OTLocation>
<OTMIMEType DisplayName="MIMEType" Protocol="https" ServerName="livelink.myServer.com" IconURL="/llk97s/otemail/emailcontainer.gif">
</OTMIMEType>
<OTName DisplayName="Nom" Protocol="https" ServerName="livelink.myServer.com" ViewURL="/livelink/livelink.exe?func=ll&objId=60751603&objAction=browse" DownloadURL="/livelink/livelink.exe?func=ll&objID=60751603&objAction=download">
2008-07-04 09 22 - ACCUSÉ DE RÉCEPTION - DEMANDE D'ACHAT # 12854509 - Louise Plante
</OTName>
<OTObjectDate DisplayName="Date" Mask="YYYY-MM-DD">
2012-05-29
</OTObjectDate>
<OTObjectSize DisplayName="Taille" Suffix="Eléments">
3
</OTObjectSize>
<Functions Protocol="https" ServerName="livelink.myServer.com" ServerPort="443" URL="/livelink/livelink.exe?func=SearchResultsFunctionMenu&hitID=1&searchCacheID=2006218356&version=0&dataID=60751603&HH=false&subtype=264" />
</SearchResult>
<SearchResult>
<OTCreatedBy DisplayName="Créé par">
<![CDATA[5063560]]>
</OTCreatedBy>
<OTLocation DisplayName="Emplacement" Protocol="https" ServerName="livelink.myServer.com" URL="/livelink/livelink.exe?func=ll&objId=60739493&objAction=browse">
</OTLocation>
<OTMIMEType DisplayName="MIMEType" Protocol="https" ServerName="livelink.myServer.com" IconURL="/llk97s/webdoc/outlook.gif">
application/x-outlook-msg
</OTMIMEType>
<OTName DisplayName="Nom" Protocol="https" ServerName="livelink.myServer.com" ViewURL="/livelink/livelink.exe?func=ll&objId=60751711&objAction=Open&vernum=1&nexturl=%2Flivelink%2Flivelink%2Eexe%3Ffunc%3Dsearch%26where1%3D12854509%26boolean2%3Dor%26where2%3D3091%2D40014%2D024%2D01%2D0%2DCE%2DL%2DQUF28%2D01%2DUA%26outputformat%3Dxml%26gofor%3D2" DownloadURL="/livelink/livelink.exe?func=ll&objID=60751711&objAction=download">
2008-07-04 09 22 - ACCUSÉ DE RÉCEPTION - DEMANDE D'ACHAT # 12854509 - Louise Plante
</OTName>
<OTObjectDate DisplayName="Date" Mask="YYYY-MM-DD">
2008-07-04
</OTObjectDate>
<OTObjectSize DisplayName="Taille" Suffix="Ko">
23
</OTObjectSize>
<Functions Protocol="https" ServerName="livelink.myServer.com" ServerPort="443" URL="/livelink/livelink.exe?func=SearchResultsFunctionMenu&hitID=2&searchCacheID=2006218356&version=1&dataID=60751711&HH=false&subtype=264" />
</SearchResult>
</SearchResults>
<!-- File: websbroker/resultbar.xml -->
<SearchResultsInformation>
<CurrentStartAt>0</CurrentStartAt>
<NumberResultsThisPage>2</NumberResultsThisPage>
<RawTotalResults>123</RawTotalResults>
<EstTotalResults>66</EstTotalResults>
<TotalResults>3</TotalResults>
<PreviousQuery>
<Parameter Name="where1"><![CDATA[12854509]]></Parameter>
<Parameter Name="boolean2"><![CDATA[or]]></Parameter>
<Parameter Name="where2"><![CDATA[3091-40014-024-01-0-CE-L-QUF28-01-UA]]></Parameter>
<Parameter Name="outputformat"><![CDATA[xml]]></Parameter>
<Parameter Name="gofor"><![CDATA[2]]></Parameter>
</PreviousQuery>
</SearchResultsInformation>
<!-- End File: websbroker/resultbar.xml -->
</Output>
有没有一种简单的方法可以用 VBA(显然没有任何浏览器)打开该页面并解析它?