I am using C# in Form.cs
Having trouble traversing the IXMLDOM
All in all I need to programmatically remove all the repeating sections
fields.
Kind of restoring section to its original state.
This section could be already repeated and a button on the section should
remove the fields.
try
{
IXMLDOMNodeList nodeList =
thisXDocument.DOM.selectNodes("/mstns:SHORT_SEARCH/mstns:INSTRUMENT");
foreach(IXMLDOMNode node in nodeList )
{
if ( node.selectSingleNode("mstns:INST_NAME").text !="" )
{
//REMOVE DEED
//REMOVE MORTGAGE
// node.removeChild(node.selectSingleNode("mstns:INST_NAME");
/*
//REMOVE ASSIGNEMENT
if (node.selectSingleNode("mstns:ASSIGNEMENT").text !="")
{
node.removeChild(node.selectSingleNode("mstns:ASSIGNEMENT"));
}
//REMOVE AGREEMENT
if (node.selectSingleNode("mstns:AGREEMENT").text !="")
{
node.removeChild(node.selectSingleNode("mstns:AGREEMENT"));
}
//REMOVE BINDED INST
if (node.selectSingleNode("mstns:BINDED_INST").text !="")
{
node.removeChild(node.selectSingleNode("mstns:BINDED_INST"));
}
*/
}
}
}
catch(Exception ex)
{
thisXDocument.UI.Alert(ex.Message );
}
Will be much ablidged.

Signature
Wed Developer
Dot Com Factory
Franck Dauché - 20 Nov 2005 21:01 GMT
Hi Boris,
Are you saying that you code that you posted didn't work? Can you tell us
more about you need exactly.
Because, indeed to remove child from a repeating group in C#, you can use:
IXMLDOMNodeList oNodes =
thisXDocument.DOM.selectNodes("/my:myFields/my:group1/my:group2");
foreach (IXMLDOMNode oNode in oNodes)
{
oNode.parentNode.removeChild(oNode);
}
Regards,
Franck Dauché
> I am using C# in Form.cs
>
[quoted text clipped - 59 lines]
>
> Will be much ablidged.