Link to home
Start Free TrialLog in
Avatar of KeithMcElroy
KeithMcElroy

asked on

closest method in vb script xml

in vb script is there a way to find the closest instance of a node working up the node tree, similar to closest in jquery.


<xml>
   <outer attr="thisattr">
     <mid>
         <inner>
         <inner>
     </mid>
  </outer>
</xml>

something like this...
foundnode = closest(node, "outer[@thisattr]")

Function closest(node,addr)
' what would go here to find the closest.
'I am thining some sort of do while loop, but don't know
End Function
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KeithMcElroy
KeithMcElroy

ASKER

so i can't use the xmldom?  I know some about the xmldom, but am stuck on how to use it to bubble up and find the first instance.  I was hoping someone might know how to write a loop that would stop when it finds the matching node.  Will give it a day in case any answers come in; if not will award points.  The jscript idea might help.