- Home /
Question by
MattyG08 · Nov 10, 2012 at 11:42 AM ·
javascriptloadingxmlsaving
Retrieving basic Strings and Ints from XML Files (JS)
Hey Folks! I have been seriously searching for the resolution to this problem but I haven't managed to find anything "straight forward" so to speak.
var monsterCollection = MonsterContainer.Load(Path.Combine(Application.dataPath, "/The Afterlife/Saves/monsters.xml"));
for (i = 0; i < monsterCollection.Monsters.Count; i++)
{
// I want to Identify individual monsters
// Something like if(Monsters.IndividualMonster.Name == "a")
}
So If you didn't understand what I am asking for, I am trying to retrieve data from individual parts of an XML File..
Here is the XML
<MonsterCollection>
<Monsters>
<Monster name="a"> // I WANT TO FIND THIS!
<Health>5</Health> // THEN USE THIS
</Monster>
</Monsters>
</MonsterCollection>
Im sure there is a relatively simple way to go about doing this that I simply haven't found.. All help is appreciated! Thanks Folks
Comment