473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

xmlDocument.SelectNodes : cannot extract data from the XML File

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>
Aug 11 '08 #1
1 1765
solved it with the help of namespacemanager
Aug 11 '08 #2

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

Similar topics

2
by: Ayende Rahien | last post by:
Serious problem I'm using Chris Lovett's SgmlReader class SgmlReader sr = new SgmlReader(); XmlDocument xdoc = new XmlDocument(); sr.DocType = "HTML"; sr.InputStream = new...
2
by: Dave | last post by:
Hi, Is there an easier way to pull a subset of nodes from one XmlDocument to another? I have the code below but would like to know if there is a more streamlined method. Thanks, Dave ...
7
by: SQLScott | last post by:
I have a Web Service in which I am trying to pass an XMLDocument as a parameter to one of the methods. I would like to use the XMLTextReader to read the XML but I am getting the following error: ...
8
by: pete | last post by:
Hi there, Can someone explain to me why I can't bind to an XmlDocument but I can bind to an XmlNodeList. It's my understanding that they both implement the IEnumerable interface which is...
2
by: Michael H | last post by:
Hello group, I have a some xml that looks like this below: <tuneRequests ct="3" xmlns:sql="urn:schemas-microsoft-com:xml-sql" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <tr...
1
by: Peter Nofelt | last post by:
Hey All, I'm running into this issue with parsing through an xml document by tag name. Below is an example xml document: File Name: things.xml <things> <people> <name>Peter</name>
3
by: Stuart Shay | last post by:
Hello All In the following XML Below which is a XMLDocument in my application. I want to remove the <extensions></extensions> Node completely. What is the best way to do this, my files are...
0
by: Karel Kral | last post by:
Hello, I have created simple COM service in .NET. COM is accessed from another not NET application by late binding call. And the problem: If I call NetComClass.Hello from another .NET code, all...
1
by: =?Utf-8?B?RGF2aWRHQg==?= | last post by:
OK, so I've created and loaded an XMLDocument object. But how do I go about using it? Specifically, how do I: 1) move to the first node (I assume I start on it when I load the XML?) 2) move to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.