I know this has been asked before(most of them only demonstrate with texture/resource downloads), there's scripts for this thing(none of them have documentation on how to use them or a brief description of limitations). I'm working on an MMO so my plan is to send the positions/rotation/animation data with wwwForms, then receive it from an XML file(since I still can't figure out how do use string variables instead; I'd rather go that route) and then take the XML data and update each individual players.
All I really need is a brief introduction on accessing nodes and there values in XML files the rest I can take from there with my Actionscripting3.0 and XML background.
Try looking around real quick first. :) I answered a question almost identical to this one yesterday, and you can find hundreds of posts by doing a simple google for this common task.
You need to use the System.xml namespace from .Net. The articles on MSDN on how to use them are pretty self explanatory. If your source is a file, start with XmlDocument.Load.
Edit: Here's some further explanation, with examples:
Since you mentioned having to read the XML data from a file, I take the liberty to assume our situations are somewhat similar in the following. I had to read some XML from a file as well. I wrote a method in a static class I could pass filepaths to, and it would load the XML file into memory so I could work with the nodes. The method below demonstrates some common tasks associated with loading and reading XML:
public static class XMLFunctionality
public static void ReadXML(string filepath)
XmlDocument XMLFile = new XmlDocument();
// How to read the XML document:
// How to grab the first node from the file:
XmlNode first = XMLFile.FirstChild;
// How to traverse nodes in the file
// (this loops over just the declaration and the root, since they are the only
// two top-level children of the XmlDocument object)
foreach (XmlNode node in XMLFile.ChildNodes)
// This is how to use a namespace manager to add a namespace to the file, in
// this case the default namespace (df)
XmlNamespaceManager NSMng = new XmlNamespaceManager(XMLFile.NameTable);
// This is how to select first all elements by the type TagName, then index
// into the returned XmlNodeList to pick out the one at index 0:
XmlNode FirstNodeFound = XMLFile.GetElementsByTagName("TagName");
// This is how to use a simple XSLT command to select multiple nodes of
// some particular type. Notice the default namespace prefix:
XmlNodeList AllNodesOfType = WellNode.SelectNodes("df:yourType", NSMng);
I don't really know what else to add. You're right that XmlDocument has a ton of functionality. That's because there's a ton of things you can do with XML. :) You're just going to have to experiment a bit, though the above should get you started.
As a general hint:
When you search for a node or some attribute, never form too complicated search queries right away. Start slow, and build the search up. Start by simply getting it to print the root node. Then dive into that, and print out the first child of the root node... Then see if you can use an element Name to find an arbitrary element among the children of the root node, etc. etc. But always print out intermediate stages so you can keep track of where you are in the document.