johnywhy
New Member
- Joined
- Sep 12, 2008
- Messages
- 47
- Office Version
- 365
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
- MacOS
howdy
this code, which loads a KML file, is working great. I'm getting the coordinates of the current oCustomNode:
but, would prefer to use relative xPaths, instead of index numbers.
how?
this does not work:
Debug.Print oCustomNode.ChildNodes("Point/coordinates").Text
this code, which loads a KML file, is working great. I'm getting the coordinates of the current oCustomNode:
Code:
Sub Add_Traverse_CustomXMLPart()
Dim oCustomPart As CustomXMLPart
Dim oCustomNode As CustomXMLNode
Dim oCustomNodes As CustomXMLNodes
'Add a Custom XML Part from a file and then load
Set oCustomPart = ActiveWorkbook.CustomXMLParts.Add
oCustomPart.Load "C:\Documents and Settings\john\My Documents\Mapping\kml2static\Faith.kml"
'Get Placemarks
Set oCustomNodes = oCustomPart.SelectNodes("/ns0:kml[1]/ns0:Document[1]/ns0:Placemark")
For Each oCustomNode In oCustomNodes
Debug.Print oCustomNode.ChildNodes(8).Text
Next
....
how?
this does not work:
Debug.Print oCustomNode.ChildNodes("Point/coordinates").Text