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...
You should be using: (Sorry this is JScript and not VB, but it works in VB too when translated):
var oNodes = XDocument.DOM.selectNodes("{XPath}");
var oNode = null;
while(oNode = oNodes.nextNode())
{
// Process current node here.
}

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
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..
RickH - 11 Aug 2004 06:59 GMT
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..
RickH - 11 Aug 2004 21:07 GMT
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
Greg Collins [MVP] - 13 Aug 2004 03:13 GMT
Can the while loop be simplified? for example:
While Not(xmlNodeA = xmlNodeListA.nextNode() Is Nothing)
' do stuff
End While

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
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