Reading an Xml file into a jagged array please help

Can someone please help me with creating a loop to read from an Xml file into a jagged array. Im using C#.

The Xml file looks like this:



This is the question text
this is answer A
this is answer B
this is answer C
answer2
this is why



This is the question text
this is why


Im using a jagged array because each question will have a different number of elements as shown above.

Can anyone suggest a good way to tackle this? An example code or structure would be appreciated. Thanks.

Comments

  • : Can someone please help me with creating a loop to read from an Xml file into a jagged array. Im using C#.
    :
    : The Xml file looks like this:
    :
    :
    :
    : This is the question text
    : this is answer A
    : this is answer B
    : this is answer C
    : answer2
    : this is why
    :
    :
    :
    : This is the question text
    : this is why
    :
    :
    : Im using a jagged array because each question will have a different number of elements as shown above.
    :
    : Can anyone suggest a good way to tackle this? An example code or structure would be appreciated. Thanks.
    :
    The easiest way is to use import the TDOMDocument interface. This interface can parse the XML file into an object tree of TXMLNodes. You can then extract the necessary data from that object tree to create your array.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion