469,308 Members | 2,707 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,308 developers. It's quick & easy.

How to get a specific Element's value in .net from an XML file?

Hi,

I have also posted this in the .net forum but I though I ask you guys as well. I have a xml file as follow:

[html]<months>
<month index="3">
<day number="1">
<item>Shareholder meeting 2PM</item>
</day>
<day number="2">
<item>Yoga 6PM</item>
</day>
<day number="3">
<item>Cooking class 12PM</item>
<item>Class reunion 7PM</item>
</day>
</month>
</months>[/html]

I need to get for example the month 3 day 3's items or values to display in a table, in this case it would be: "cooking class.." and "class reunion ..". I have been messing around with the xmltextreader class but I can't find an intuitive way to loop through my xml document and grab my specific days item list. Can you help me?

Thanks,
Chris
Mar 16 '07 #1
4 4275
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN....

You can use XMLDocument and eventually XPathDocument.
See these articles:
Reading XML File using XmlDocument,
Manipulate XML data with XPath and XmlDocument.
Mar 19 '07 #2
dorinbogdan
839 Expert 512MB
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Mar 21 '07 #3
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Sorry for the late reply but yes I did. I used the Xpath method and solved the problem. Thank you for the help :-)
Apr 12 '07 #4
dorinbogdan
839 Expert 512MB
Thanks for reply,
I'll let the thread open for further comments or related questions.
Dorin.
Apr 13 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.