I have a function that assigns a value to a field and clones a nested repeating table. the text values in the repeating table will always be the same. the number of them may change from template to template, but it will not change in the form. when the value is written the to section it writes a number that can be tied back to it origination (a row number). What I want to do is iterate through a number type field (RateValue) and set the values to 0.00 because when I clone this repeating section and table it copies the values that may already be entered. I am missing the mark. here is a snapshot of my form schema:
https://picasaweb.google.com/lh/photo/XbdbzdeU6TguMfj-NGwYk9MTjNZETYmyPJy0liipFm0?full-exif=true

I am passing a row number in so I can identify which repeating section I want to iterate thru. I can get to my nested section, but I cant figure out how to iterate and update RateValue (in the nested repeating table)
//const string CA = "/my:myFields/my:myRateDetails/my:CmdtyAssignmentGrp/my:CommodityAssignment";
//const string RateTable = "/my:myFields/my:myRateDetails/my:CmdtyAssignmentGrp/my:CommodityAssignment/my:RateGrp/my:Rate";
public void setRowVal(string rNum)
{
XPathNavigator root = MainDataSource.CreateNavigator();
string ns = NamespaceManager.LookupNamespace("my");
XPathNodeIterator sIter = root.Select(CA + "[" + rNum + "]", NamespaceManager);
XPathNodeIterator xIter = root.Select(RateTable, NamespaceManager);
foreach (XPathNavigator sNode in sIter)
{
string field1 = row.SelectSingleNode("my:CmdtyRow", NamespaceManager).Value;
if (field1 == rNum)
{
XPathNodeIterator xIter = sNode.Select("my:RateGrp/my:Rate", NamespaceManager);
foreach (XPathNavigator xNode in xIter)
//while (xIter.MoveNext())
{
using (XmlWriter writer = sNode.SelectSingleNode(RateTable, NamespaceManager).AppendChild())
{
writer.WriteStartElement("Rate", ns);
writer.WriteElementString("RateValue", ns, "0.00");
// writer.WriteAttributeString("xsi", "nil", null, "true");
writer.WriteEndElement();
writer.Close();
}
}
break;
}
}
}
any one see what I am missing?