traversing xmlnode a 2nd time fails...

R

RickH

Dim xmlNodeListA, xmlNodeListB AS IXMLDOMNodeList
xmlNodeListA = thisDocument.DOM.selectNodes
("/dfs:myfields/dfs:dataFields/d:Offloaf_Request")

For Each xmlNodeA In xmlNodeListA
xmlNodeListB = xmlNodeA.childNodes

For Each xmlNodeB in xmlNodeListB

'read data--- works fine
Next
'Do calculations from read data in all xmlNodeListB
'Walk thru xmlNodeListB again to write data
For Each xmlNodeB in xmlNodeListB

'write data ---fails, says no instance of object
Next
Next


I can't seem to find the correct syntax for walkung thru the node a second
time..any ideas??
Tried everything I could think of..
 
R

RickH

Putting xmlNodeListB.reset before I run thru the 2nd time is supposed to set
the pointer back to the beginning, but it doesn't seem to...
 
R

RickH

I'll try the While....construct.
I did get it to work by using for i to n..Next construct.
Appears the For Each ..Next would not let me rewalk the same node--.reset
didn't do anything..
 
R

RickH

this syntax worked for VB
xmlNodeListA = thisXDocument.DOM.selectNodes("/dfs:myFields/dfs:dataFields/*")
xmlNodeA = Nothing
xmlNodeA = xmlNodeListA.nextNode()
While Not xmlNodeA Is Nothing

'do stuff

xmlNodeA = xmlNodeListA.nextNode()
End While
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top