If you use XmlElement instead of XmlNode for your nodes you can use the
GetElementsByTagName function which returns a XmlNodeList.
Something like this:
XmlNodeList Xnodes = Xdoc.DocumentElement.GetElementsByTagName(KeyName);
if (Xnodes.Count > 0)
{
Xnodes[0].InnerText = Value;
}
else
{
XmlNode Xnode = Xdoc.CreateNode(XmlNodeType.Element,KeyName,"");
Xnode.InnerText = Value;
Xdoc.DocumentElement.AppendChild(Xnode);
}
Cristi said:
I made an application which uses SelectNodes method from XmlNode. I just
found that this method is not supported in Compact framework. Do you know a
way to replace this method or somehow to populate the XmlNodeList?