Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Banned
 
Posts: 3
Default How To Do Relative xPath In CustomXMLNode?

howdy

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
    ....
but, would prefer to use relative xPaths, instead of index numbers.

how?

this does not work:
Debug.Print oCustomNode.ChildNodes("Point/coordinates").Text
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel invoke REST service function with Xpath fn parse result! Rand0m1y Excel Worksheet Functions 0 June 4th 09 03:43 PM
~ ~ ~ Its All Relative??? 23hitman Excel Discussion (Misc queries) 4 October 19th 08 02:24 AM
What relative row I'm in? fedude Excel Worksheet Functions 3 March 10th 08 02:01 PM
xpath error? Runtime Error 13 type mismatch Steve M[_2_] Excel Discussion (Misc queries) 0 January 17th 08 01:16 AM
xpath error? Runtime Error 13 type mismatch SteveM Excel Discussion (Misc queries) 1 December 4th 07 09:16 AM


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"