Beginner XML Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bosco
    New Member
    • Apr 2006
    • 3

    Beginner XML Question

    First of all, apologies if this has been answered elsewhere previously.

    I'm in the midst of my final year uni project and I'm using C# to develop software for creating/storing American Football plays (in a playbook). What I'm trying to do is store each playbook as an XML file, with each XML file containing numerous instances of the element <play>.

    I'm attempting to write the XML files in the following format:

    Code:
    <?xml version="1.0"?>
    <playbook>
      <title>Playbook Title</title>
      <unit>Offence</unit>
      <play>
        <name>play name</name>
        <form>play formation</form>
        <set>formation set</set>
      </play>
      <play>
        <name>play name</name>
        <form>play formation</form>
        <set>formation set</set>
      </play>
      ... //numerous instances of <play>
    </playbook>
    I have a couple of questions:
    1. Is this kind of formatting/syntax advisable for what I'm trying to do?
    &
    2. How would one go about this in C#?

    At the moment I can write the xml file fine, but it can only store one instance of the <play> element.

    Thanks in advance,
    -Patrick
Working...