Hi Guys,
This is my first post. I've been using the forum for a while to get info so I'm hoping you might be able to point me in the right direction here!
My problem is that I have XML (see below) that I would like to go through but I am confused as to how best to do this. I have spent the last few days looking online and reading up on how to do this but I'm getting nowhere fast. As you can see from the XML (which is a dummy version) I have values I need to get within tags and also outside of tags.
For example, using the XML sample below, I might want to get the "test guy" value out of the Person tag, the address details within LocationDetails and nothing else. At the moment I can display all elements from the XML but then I don't get the values in the address tags OR I can target a specific tag id and get that value (i.e. the address) but then I don't get the other information like the person's name.
Is there a way to use xDoc.GetElementsByTagName("Person") and get the Text value of "test guy"? This would be great if I could do this as I can just specify the actual tags I want from the xml.
I am building this in Visual Studio 2008 using C# but on the ver 2 framework.
Thanks in advance for looking at this with me.
Moderators - If this is not in the right section than I'm sorry, feel free to move to a more appropriate location.
<messages>
<Person id="0" text="test guy" fieldid="1"></Person>
<LocationDetails>
<address1>place name</address1>
<address2></address2>
<town>test town</town>
<state>NY</state>
<country>US</country>
</LocationDetails>
<Schedules>
<Schedule>
<Times>
<ScheduleTime Mon="true" Start="09:00" End="17:30"></ScheduleTime>
<ScheduleTime Tue="true" Start="09:00" End="17:30"></ScheduleTime>
<ScheduleTime Weds="true" Start="09:00" End="17:30"></ScheduleTime>
<ScheduleTime Thurs="true" Start="09:00" End="17:30"></ScheduleTime>
<ScheduleTime Fri="true" Start="09:00" End="17:30"></ScheduleTime>
<ScheduleTime Fri="false" Start="09:00" End="17:30"></ScheduleTime>
<ScheduleTime Fri="false" Start="09:00" End="17:30"></ScheduleTime>
</Times>
</Schedule>
</Schedules>
</messages>