blog games developers documentation portfolio gallery

Documentation:

GetNodeWithProperty()

To use this functions you need to include the line
using SimpleXmlExtensions;
in your source code.

Hashtable GetNodeWithProperty(string aKey, string aValue)


This function is defined for Hashtable and for ArrayList and always returns a Hashtable (or null), since Hashtables are the only objects in the hierarchy that can store key value pairs.

It moves down the hierarchy looking for nodes of type Hashtable with a key value pair that corresponds to the parameters. This is regardless of the tagname and regardless of the nesting level. The first Hashtable that has the correct key value pair is returned.

When the key + value is not found, it returns NULL.

Example:
private Hashtable GetBookByGeorgeOrwell() {
Hashtabel bookNode = xmlNode.GetNodeWithProperty("Author", "George Orwell");
if(bookNode==null) {
Debug.Log("Nothing found");
} else {
Debug.Log("Found Hashtable (written as JSON): " + ((Hashtable)bookNode).JsonString());
}
return bookNode;
}







follow us