473,508 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

6 New Member
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 4390
dorinbogdan
839 Recognized Expert Contributor
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 Recognized Expert Contributor
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
Kazmataz
6 New Member
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 Recognized Expert Contributor
Thanks for reply,
I'll let the thread open for further comments or related questions.
Dorin.
Apr 13 '07 #5

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

Similar topics

2
1403
by: Brett Gerhardi | last post by:
Hi all, I'm trying to something that I'm sure must be possible within the schema language but I cannot seem to work it out. Briefly, I am defining a multi-tiered base structure - each tier has...
15
3286
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
2
5071
by: Tarren | last post by:
Hi: The problem I am having is when I validate an xml file to a schema, it is erroring out every element. I think this has something to do with me defining/referencing the namespaces. I have...
15
3287
by: janhm | last post by:
Hello. I need to loop through a xml file finding a specific innerxml text and then ad the content to a treeview. For example. If the innerxml im searching for is "item001" then I want the...
2
1342
by: Marc Jennings | last post by:
Hi there, I have been given a rather poor schema for an XML file in the following format : ><item> > <key>ProductCode</key> > <value>1234-5678</value> > <key>Description</key> >...
3
3965
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
2
18132
by: mlb5000 | last post by:
I seem to be having issues validating an XML document using my schema. Both are below: The Schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema...
0
1327
by: Adam dR. | last post by:
I would like to create an XSD that will verify the xml below has one <configelement with the name attribute equal to 'DBC' all other <configelements are optional and their values don't matter. I...
1
3236
by: radhakrishnanrs | last post by:
Hi, Is there any option to count the total number of specific element using XSL? XML File: <root> <child>Name: <child1>Text1</child> <child1>Text2</child>
5
4436
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.