0
以下のXMLから緯度と経度を解析しようとしていますが、複数の名前空間があります。私も値を取得していません。VBA内の複数の名前空間からの値の解析
<ns2:Search xmlns:ns2="http://www.navteq.com/lbsp/Search-Search/4">
<Response>
<MetaInfo>...</MetaInfo>
<View xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:SearchResultsViewType">
<ViewId>0</ViewId>
<Result>
<Relevance>1.0</Relevance>
<MatchLevel>houseNumber</MatchLevel>
<MatchQuality>...</MatchQuality>
<MatchType>pointAddress</MatchType>
<Location>
<LocationId>NT_nL.dzNwdSJgdcF4U8dYEiC_yADM</LocationId>
<LocationType>address</LocationType>
<DisplayPosition>
<Latitude>37.37634</Latitude>
<Longitude>-122.03405</Longitude>
</DisplayPosition>
<NavigationPosition>...</NavigationPosition>
<MapView>...</MapView>
<Address>...</Address>
</Location>
</Result>
</View>
</Response>
</ns2:Search>
コードの一部:
Dim Request As New XMLHTTP30
Dim Results As New DOMDocument30
Dim LatitudeNode As IXMLDOMNode
Results.LoadXML Request.responseText
Results.setProperty "SelectionNamespaces", "xmlns:ns2='http://www.navteq.com/lbsp/Search-Search/4'"
Set LatitudeNode = Results.SelectSingleNode("/ns2:Search/ns2:Response/ns2:View/ns2:Result/ns2:Location:/ns2:DisplayPosition/ns2:Latitude")