A very very strange removechild error, or I am missing something really important.
Removing all rows in a repeating table using removechild with vb.net code as below:
01 Dim numRows = thisXDocument.DOM.selectNodes("//d:Details").length()
02 Dim deleteNode As IXMLDOMNode
03 thisXDocument.UI.Alert("Total of " & numRows & " to be deleted")
04 For i = 1 To numRows
05 thisXDocument.UI.Alert("Deleting Row " & i)
06 deleteNode = thisXDocument.DOM.selectSingleNode("//d:Details[" & i & "]")
07 If deleteNode Is Nothing Then
08 ' Do Nothing
09 End If
10 deleteNode.parentNode.removeChild(deleteNode)
11 Next i
Now if the Repeating Table had 10 rows, I would assume the code above removes all the 10 rows, BUT NO; It removes Rows 1,3,5,7,9 and leaves behind Rows 2,4,6,8,10. And while doing that it does alert at line number 5, 'Deleting Row 1', 'Deleting Row 2', 'Deleting Row 3', etc so on for all 10 rows. numRows contains a value of '10' at line number 01 and alerts the value correctly at line number 03
So in the repeating table, we now have Rows 2,4,6,8,10
Next I execute the code, and Row 4 & Row 8 (from the original table) are still there.
Its skipping a row everytime.
Any thoughts? I have to resolve this. Any other options to remove all rows in a repeating table?
Thanks.