RemoveChild() を使用して子要素の一部を削除しようとすると、しかし、例外をスローします。以下にコードを添付しました。
nodeName = doc.SelectSingleNode("//Equipment//DataCollections//EnabledIDs//MyID[@id='" + attrValue + "']");
// Found the nodeName successfully druing run time.
doc.DocumentElement.RemoveChild(nodeName);
// faild to Remove the node
以下にエラーを表示:
An unhandled exception of type 'System.ArgumentException' occurred in System.Xml.dll
Additional information: The node to be removed is not a child of this node.
ノードを削除するにはどうすればよいですか?
[アップデート]
VS2005 & .NET 2.0 を使用。