I am working on loading some XML into Unity via .Net and firstoff just want to make sure what I am doing seems okay (it does work) and secondly I am having difficultly finding (and I have been looking like crazy) for a way to determine the length/amount of how many childNodes live within a specific node. My code looks like this:
import System;
import System.IO;
import System.Xml;
function Start(){
var xmlFile = Application.dataPath + "/test.xml";
if (File.Exists(xmlFile)){
var sr = new StreamReader(xmlFile);
var txt = sr.ReadToEnd();
var xml = new XmlDocument();
xml.LoadXml(txt);
// Would like to iterate by length/amount here
for (i in xml.FirstChild){
Debug.Log(i.InnerXml);
}
}
}
Thanks,
– Clint