J
Joshua Russell
Hi,
I wish to parse an XML file into some sort or array or multidimensional storage. The XML file is as follows (without any parent tags just to give you an idea of the structure)...
<Ship Name="Disrupter" Class="CC" PrimaryTarget="CR" BattleOrder="1" Guns="5" Power="2"></Ship>
<Ship Name="Zealot" Class="CR" PrimaryTarget="CC" BattleOrder="2" Guns="25" Power="5"></Ship>
<Ship Name="Drone" Class="CC" PrimaryTarget="CC" BattleOrder="3" Guns="4" Power="2"></Ship>
<Ship Name="Invader" Class="CC" PrimaryTarget="CO" BattleOrder="4" Guns="3" Power="4"></Ship>
<Ship Name="Reformer" Class="CO" PrimaryTarget="FR" BattleOrder="5" Guns="5" Power="6"></Ship>
In PHP (my primary programming langugage) I would be able to create a multidimensional array that that woudl look something like this...
[0] ->
[Name] = "Disrupter"
[Class] = "CC"
[PrimaryTarget] = "CR"
[BattleOrder] = "1"
[Guns] = "5"
[Power] = "2"
[1] ->
[Name] = "Zealot"
[Class] = "CR"
[PrimaryTarget] = "CC"
[BattleOrder] = "2"
[Guns] = "25"
[Power] = "5"
etc...
I understand that you can't have text identifiers for array values in C# like you can in PHP. Can anyone suggest anything?
Thanx Josh
I wish to parse an XML file into some sort or array or multidimensional storage. The XML file is as follows (without any parent tags just to give you an idea of the structure)...
<Ship Name="Disrupter" Class="CC" PrimaryTarget="CR" BattleOrder="1" Guns="5" Power="2"></Ship>
<Ship Name="Zealot" Class="CR" PrimaryTarget="CC" BattleOrder="2" Guns="25" Power="5"></Ship>
<Ship Name="Drone" Class="CC" PrimaryTarget="CC" BattleOrder="3" Guns="4" Power="2"></Ship>
<Ship Name="Invader" Class="CC" PrimaryTarget="CO" BattleOrder="4" Guns="3" Power="4"></Ship>
<Ship Name="Reformer" Class="CO" PrimaryTarget="FR" BattleOrder="5" Guns="5" Power="6"></Ship>
In PHP (my primary programming langugage) I would be able to create a multidimensional array that that woudl look something like this...
[0] ->
[Name] = "Disrupter"
[Class] = "CC"
[PrimaryTarget] = "CR"
[BattleOrder] = "1"
[Guns] = "5"
[Power] = "2"
[1] ->
[Name] = "Zealot"
[Class] = "CR"
[PrimaryTarget] = "CC"
[BattleOrder] = "2"
[Guns] = "25"
[Power] = "5"
etc...
I understand that you can't have text identifiers for array values in C# like you can in PHP. Can anyone suggest anything?
Thanx Josh