473,938 Members | 45,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem using XPathDocument

Hi,

I am getting XmlException while running the following code:

string sConfigXPath = Constants.CONST _CONFIG_XPATH +
"[@"+Constants.CO NST_CONFIG_TYPE _ID + "="+this.iT ype + "]";
string sConfigFile = Constants.CONST _CONFIG_FILE_LO CATION; //Returns me
the physical path @"C:\Temp\MyXml .xml"
XPathDocument xpdConfig = new
XPathDocument(s ConfigFile,XmlS pace.Default); //XmlException raised here.
XPathNavigator xpnConfig =
((IXPathNavigab le)xpdConfig).C reateNavigator( );
XPathNodeIterat or iter = xpnConfig.Selec t(sConfigXPath) ;
while(iter.Move Next())
{
LoadNode(iter.C urrent);
}

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


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

string sConfigXPath = Constants.CONST _CONFIG_XPATH +
"[@"+Constants.CO NST_CONFIG_TYPE _ID + "="+this.iT ype + "]";
string sConfigFile = Constants.CONST _CONFIG_FILE_LO CATION; //Returns me
the physical path @"C:\Temp\MyXml .xml"
XPathDocument xpdConfig = new
XPathDocument(s ConfigFile,XmlS pace.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.Xml Exception' occurred in
system.xml.dll

Additional information: System error.

Regards,
Atul

"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..


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

string sConfigXPath = Constants.CONST _CONFIG_XPATH +
"[@"+Constants.CO NST_CONFIG_TYPE _ID + "="+this.iT ype + "]";
string sConfigFile = Constants.CONST _CONFIG_FILE_LO CATION; //Returns me the physical path @"C:\Temp\MyXml .xml"
XPathDocument xpdConfig = new
XPathDocument(s ConfigFile,XmlS pace.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*****@hotmai l.com> wrote in message
news:Ol******** ******@tk2msftn gp13.phx.gbl...
Hi,

I am getting XmlException while running the following code:

string sConfigXPath = Constants.CONST _CONFIG_XPATH +
"[@"+Constants.CO NST_CONFIG_TYPE _ID + "="+this.iT ype + "]";
string sConfigFile = Constants.CONST _CONFIG_FILE_LO CATION; //Returns me
the physical path @"C:\Temp\MyXml .xml"
XPathDocument xpdConfig = new
XPathDocument(s ConfigFile,XmlS pace.Default); //XmlException raised here.
XPathNavigator xpnConfig =
((IXPathNavigab le)xpdConfig).C reateNavigator( );
XPathNodeIterat or iter = xpnConfig.Selec t(sConfigXPath) ;
while(iter.Move Next())
{
LoadNode(iter.C urrent);
}

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
3417
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 please help me in converting this c# code to vb.net. I tried, but it is not giving the output. Here is the c# code using System using System.Collections using System.ComponentModel using System.Data using System.Drawing using System.Web using...
2
5292
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); xmlSW.Close(); Which gives me this XML file: <NewDataSet>
2
2763
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); xmlSW.Close(); Which gives me this XML file: <NewDataSet>
5
2117
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 progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
4
4365
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 application crashes with the same error message I would get when writing <brand no closing tag. To make everything a little stranger, even <br></brseems to be bad while <lbr/is fine. Ive tried some other tag names and the problem only appears with...
0
10126
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9963
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11282
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9853
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7377
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6072
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6286
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3495
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.