C
Caroline M
Hi there,
I'm sure this has been posted before but I didn't know how to search
for it because I don't know the name for what I am trying to do so
I'll try and explain it as best I can.
I have an application that captures some data about football players.
I have fields for name, date of birth, nationality etc and things like
position such as Goalkeeper, Striker etc. I need to store all this
data in an XML file. In the case of the positions, I will populate a
control in the program with a predetermined list of available
positions (which also needs to be in the XML file) and then I simply
select one from the list for each player. My question is, how do I
store that for each player?
If I have something like:
<positions>
<position>Goalkeeper</position>
<position>Striker</position>
...
</positions>
<players>
<player>
<player_name>David Beckham</player_name>
<player_position> ??? what goes here??? </player_position>
...
</player>
</players>
What do I put in my player_position element above? Obviously one
solution is simply to copy the text from the position element but
thats not ideal because when I load the application from the XML file
later I'd want to be able to populate the UI control with the
available positions (which I might change the names of) and then
indicate that David Beckham is in the first position in the list for
exmple and avoid that duplication.
I hope that makes sense!
Thanks,
Caroline Middlebrook
I'm sure this has been posted before but I didn't know how to search
for it because I don't know the name for what I am trying to do so
I'll try and explain it as best I can.
I have an application that captures some data about football players.
I have fields for name, date of birth, nationality etc and things like
position such as Goalkeeper, Striker etc. I need to store all this
data in an XML file. In the case of the positions, I will populate a
control in the program with a predetermined list of available
positions (which also needs to be in the XML file) and then I simply
select one from the list for each player. My question is, how do I
store that for each player?
If I have something like:
<positions>
<position>Goalkeeper</position>
<position>Striker</position>
...
</positions>
<players>
<player>
<player_name>David Beckham</player_name>
<player_position> ??? what goes here??? </player_position>
...
</player>
</players>
What do I put in my player_position element above? Obviously one
solution is simply to copy the text from the position element but
thats not ideal because when I load the application from the XML file
later I'd want to be able to populate the UI control with the
available positions (which I might change the names of) and then
indicate that David Beckham is in the first position in the list for
exmple and avoid that duplication.
I hope that makes sense!
Thanks,
Caroline Middlebrook