Having some trouble parsing this bit of XML. Can you help?

A

Anthony P.

I've not used XML a whole lot and it's driving me nuts. I've learned
how to parse simple XML like this:

<Response>
<name>Anthony Papillion</name>
<email>[email protected]</name>
</Response>

I can parse this using the xmlTextReader and it's pretty easy. But I'm
faced with a bit more complex XML and I have no idea how to handle it.
Here is a snippet:

<Response>
<Messages>
<Message>
<sender>Anthony Papillion</sender>
<subject>Just a Test</subject>
<date>July 15, 2010</date>
</Message>
<Message>
<sender>John Doe</sender>
<subject>Another Test</subject>
<date>July 15, 2010</date>
</Message>
</Messages>
</Response>

Now, as you can see, it's not particularly complex, but I don't know
how to parse the multiple <message> nodes that are children of
<messages>.

Can anyone help?

Thanks!
Anthony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top