473,326 Members | 2,126 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,326 software developers and data experts.

Problem using XPathDocument

Hi,

I am getting XmlException while running the following code:

string sConfigXPath = Constants.CONST_CONFIG_XPATH +
"[@"+Constants.CONST_CONFIG_TYPE_ID + "="+this.iType + "]";
string sConfigFile = Constants.CONST_CONFIG_FILE_LOCATION; //Returns me
the physical path @"C:\Temp\MyXml.xml"
XPathDocument xpdConfig = new
XPathDocument(sConfigFile,XmlSpace.Default); //XmlException raised here.
XPathNavigator xpnConfig =
((IXPathNavigable)xpdConfig).CreateNavigator();
XPathNodeIterator iter = xpnConfig.Select(sConfigXPath);
while(iter.MoveNext())
{
LoadNode(iter.Current);
}

What am I missing here, please guide?
--
Thanks & Regards,
Atul Shukla
Nov 12 '05 #1
3 1646


Atul wrote:
I am getting XmlException while running the following code:

string sConfigXPath = Constants.CONST_CONFIG_XPATH +
"[@"+Constants.CONST_CONFIG_TYPE_ID + "="+this.iType + "]";
string sConfigFile = Constants.CONST_CONFIG_FILE_LOCATION; //Returns me
the physical path @"C:\Temp\MyXml.xml"
XPathDocument xpdConfig = new
XPathDocument(sConfigFile,XmlSpace.Default); //XmlException raised here.


What does the exception say?

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #2
I am getting following error:

An unhandled exception of type 'System.Xml.XmlException' occurred in
system.xml.dll

Additional information: System error.

Regards,
Atul

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...


Atul wrote:
I am getting XmlException while running the following code:

string sConfigXPath = Constants.CONST_CONFIG_XPATH +
"[@"+Constants.CONST_CONFIG_TYPE_ID + "="+this.iType + "]";
string sConfigFile = Constants.CONST_CONFIG_FILE_LOCATION; //Returns me the physical path @"C:\Temp\MyXml.xml"
XPathDocument xpdConfig = new
XPathDocument(sConfigFile,XmlSpace.Default); //XmlException raised here.


What does the exception say?

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3
Problem Solved. I checked my XML file, it was wrong.
Sorry for the trouble.

Thanks
Atul

"Atul" <py*****@hotmail.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
Hi,

I am getting XmlException while running the following code:

string sConfigXPath = Constants.CONST_CONFIG_XPATH +
"[@"+Constants.CONST_CONFIG_TYPE_ID + "="+this.iType + "]";
string sConfigFile = Constants.CONST_CONFIG_FILE_LOCATION; //Returns me
the physical path @"C:\Temp\MyXml.xml"
XPathDocument xpdConfig = new
XPathDocument(sConfigFile,XmlSpace.Default); //XmlException raised here.
XPathNavigator xpnConfig =
((IXPathNavigable)xpdConfig).CreateNavigator();
XPathNodeIterator iter = xpnConfig.Select(sConfigXPath);
while(iter.MoveNext())
{
LoadNode(iter.Current);
}

What am I missing here, please guide?
--
Thanks & Regards,
Atul Shukla

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: canasdaq | last post by:
Can anyone please help me. I was looking at the article "http://www.eggheadcafe.com/articles/20030603.asp". I am new to .net and know nothing in c#. I want to write a menu in asp.net. Can anyone...
2
by: chris | last post by:
Hi there, I create an XML file from a dataset like this: System.IO.StreamWriter xmlSW = new System.IO.StreamWriter(FILENAME); dsUserData1.WriteXml(xmlSW, XmlWriteMode.WriteSchema);...
2
by: chris | last post by:
Hi there, I create an XML file from a dataset like this: System.IO.StreamWriter xmlSW = new System.IO.StreamWriter(FILENAME); dsUserData1.WriteXml(xmlSW, XmlWriteMode.WriteSchema);...
5
by: prasanta | last post by:
Hello, I have a xml file. when i am trying to load through XPathDocument and try to get XPathNodeIterator its not working . my xml is loking like <?xml version="1.0" ?> <?mso-application...
4
by: Christofer Dutz | last post by:
Hi, I am having a small problem, that is driving me nuts. My application reads some Xml and runs 2 Xsl Transformations to generate HTML. As soon as my second XSL introduces some <br/tags, the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.