Connecting Tech Pros Worldwide Help | Site Map

xmlDocument.SelectNodes : cannot extract data from the XML File

Newbie
 
Join Date: Jul 2008
Posts: 19
#1: Aug 11 '08
Hello everyone

i am trying to extract the nodes from the File with the following code. However i am not succesfull in extracting the codes from the xpath given below...i do not know wht is my mistake in the xpath as i always get temp =0

would be gratefull for any help

try
{
XmlDocument xDoc = new XmlDocument();

xDoc.Load("Test.xml");
XmlNodeList temp = xDoc.SelectNodes("/Project/Calendars/Calendar[Name='Siemens (Österreich)']WeekDays/WeekDay/Timeperiod/FromDate");

}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
i am having the following xml file

<?xml version="1.0" ?>
- <Project xmlns="http://schemas.microsoft.com/project">
<Name>Test.xml</Name>
<Title>MS-Project2000- Kalender</Title>
<Author>Competence Center Projektmanagement</Author>
<CreationDate>1998-09-10T13:43:00</CreationDate>
<LastSaved>2008-07-11T13:01:00</LastSaved>
..
...
...
- <Calendars>
- <Calendar>
<UID>11</UID>
<Name>Siemens (Österreich)</Name>
- <WeekDays>
- <WeekDay>
<DayType>0</DayType>
<DayWorking>0</DayWorking>
- <TimePeriod>
<FromDate>1998-04-13T00:00:00</FromDate>
Newbie
 
Join Date: Jul 2008
Posts: 19
#2: Aug 11 '08

re: xmlDocument.SelectNodes : cannot extract data from the XML File


solved it with the help of namespacemanager
Reply