budidharma wrote:
public string GetValue(string key) { // ITERATE THROUGH KEYS, IF FOUND, RETURN THE VALUE, OTHERWISE, return "NULL"; return "NULL"; }
You can use the SelectNodes[^] or the SelectSingleNode[^] method on XmlDocument to do that. Give it an XPath expression and it will return you the appropriate nodes. In your case, it will probably look like
xmlDoc.SelectNodes("//nodeName[@key='keyValue'");
assuming the key value pairs are of the form <nodeName key="KeyValue value="Value>
budidharma wrote:
public bool SetValue(string key, string value) { // ITERATE THROUGH THE VALUES, FIND THE CORRECT NODE // IF NODE IS FOUND, MODIFY THE VALUE // IF NODE IS NOT FOUND, CREATE THE NEW VALUE return true; }
To modify an existing node, get a reference to it using the above method. Then use the Attributes property and the indexer to get a reference to the attribute and then just set the Value[^] property to the desired value. You can use the CreateNode[^] method to create a new node.
budidharma wrote:
public ArrayList GetAllValues() {
You can again use Sele