Hi Richard, Welcome to the board.
You made a small mistake in the following statement
total = dom.documentElement.selectSingleNode("dfs:dataFields/d:dtOrderTracking/@OrderVal").value; //it is the in this line that causes the error
You are placing "i" in between the string as part of the string, but value of "i" should go in place of "i". So your statement should be
total = dom.documentElement.selectSingleNode("dfs:dataFields/d:dtOrderTracking["+i+"]/@OrderVal").value;
But there is another best way that you can follow here, you already getting reference to the "d:dtOrderTracking" nodes in
"var nodeList = dom.selectNodes("/dfs:myFields/dfs:dataFields/d:dtOrderTracking");"
you can use this reference instead of selecting the whole node again. so your for loop can be
for (var i=1; i<listLength; i++) {
total = nodeList.selectSingleNode("@OrderVal").value;
XDocument.UI.Alert(total);
}
Hope this helps!
Agni
InfoPathDev India