473,804 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

An unhandled exception of type 'System.Xml.Xsl .XsltException' occu

one
Hi, can some experts out there tell me why I am getting:
An unhandled exception of type 'System.Xml.Xsl .XsltException' occurred in system.xml.dll. .. (No details in the error dialog box)

FileStream fs = new FileStream("tes t.xml",FileMode .OpenOrCreate);
StreamReader sr = new StreamReader(fs );
XmlTextReader xtr = new XmlTextReader(s r);
XmlDocument xd = new XmlDocument();
xd.Load(xtr);
XmlElement root = xd.DocumentElem ent;
XmlNamespaceMan ager ns = new XmlNamespaceMan ager(xd.NameTab le);
ns.AddNamespace ("soap", @"http://schemas.xmlsoap .org/soap/envelope/");
string temp = @"soap:Envel ope/soap:Body/test:TestMessag e/test:Body/test:Text";
XmlNodeList nl = root.SelectNode s(temp, ns); <---- This line throw the exception.

I am thinking maybe the dotnet framework doesn't like the colon in the XPath? Has anyone seen this before?
Or is it because I have two namespaces (i.e. 'soap' and 'test')?
Nov 12 '05 #1
2 2066
one wrote:
Hi, can some experts out there tell me why I am getting:
An unhandled exception of type 'System.Xml.Xsl .XsltException' occurred in system.xml.dll. .. (No details in the error dialog box)

FileStream fs = new FileStream("tes t.xml",FileMode .OpenOrCreate);
StreamReader sr = new StreamReader(fs );
XmlTextReader xtr = new XmlTextReader(s r);
XmlDocument xd = new XmlDocument();
xd.Load(xtr);
XmlElement root = xd.DocumentElem ent;
XmlNamespaceMan ager ns = new XmlNamespaceMan ager(xd.NameTab le);
ns.AddNamespace ("soap", @"http://schemas.xmlsoap .org/soap/envelope/");
You should aslo add a namespace binding for "test" namespace prefix.
string temp = @"soap:Envel ope/soap:Body/test:TestMessag e/test:Body/test:Text";


--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2
one wrote:
Hi, can some experts out there tell me why I am getting:
An unhandled exception of type 'System.Xml.Xsl .XsltException' occurred in system.xml.dll. .. (No details in the error dialog box)

FileStream fs = new FileStream("tes t.xml",FileMode .OpenOrCreate);
StreamReader sr = new StreamReader(fs );
XmlTextReader xtr = new XmlTextReader(s r);
XmlDocument xd = new XmlDocument();
xd.Load(xtr);
XmlElement root = xd.DocumentElem ent;
XmlNamespaceMan ager ns = new XmlNamespaceMan ager(xd.NameTab le);
ns.AddNamespace ("soap", @"http://schemas.xmlsoap .org/soap/envelope/");
You should aslo add a namespace binding for "test" namespace prefix.
string temp = @"soap:Envel ope/soap:Body/test:TestMessag e/test:Body/test:Text";


--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #3

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

Similar topics

1
536
by: Rafael | last post by:
Hi, I hope I can find some help for this problem IDE: Visual Studio.NET 2003 Developer Editio Language: C# Problem: "An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll. Additional information: Object reference not set to an instance of an object. Visual Studio's IDE is not allowing me to develop projects in C#... I've trying to create a simple Windows Forms project using Visual Studio.NET...
0
1549
by: Oliver | last post by:
Hello, I may have posted in the wrong place, if so, feel free to move my post (just notify me where you put it via email or something) I’m having a problem with my program that I cant readily explain. The program connects to, then reads and creates a new flat old Dbase files (.DBF) stored on a network drive. The program itself is run from the very same network drive/folder.
3
2960
by: Professor Frink | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished, actually), my first VB.Net application. It's a forms application that is going to be used to extract data from a legacy system (VSAM based mainframe file structure), and output data in pipe-delimited record layouts, multiple record types per file, one file per chosen client. I have been working on...
0
352
by: one | last post by:
Hi, can some experts out there tell me why I am getting: An unhandled exception of type 'System.Xml.Xsl.XsltException' occurred in system.xml.dll... (No details in the error dialog box) FileStream fs = new FileStream("test.xml",FileMode.OpenOrCreate); StreamReader sr = new StreamReader(fs); XmlTextReader xtr = new XmlTextReader(sr); XmlDocument xd = new XmlDocument(); xd.Load(xtr); XmlElement root = xd.DocumentElement;...
4
2256
by: Craig831 | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished, actually), my first VB.Net application. It's a forms application that is going to be used to extract data from a legacy system (VSAM based mainframe file structure), and output data in pipe-delimited record layouts, multiple record types per file, one file per chosen client. I have been working on...
5
5756
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by thread.Abort()) is reported twice: once in the debug window, and once through the message box. Is it because the thread was sleeping when the exception occurred?
5
3312
by: Samuel R. Neff | last post by:
When you have an unhandled exception in vb.net how do you view the exception information in the debugger? In C# the debugger creates a local variable that points to the exception and you can view it in one of the windows (autos or locals, don't remember which). That doesn't appear to be the case with vb.net. I also tried using the command window to inspect "Err" but that gave nothing useful (always empty).
0
1993
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks about in a new application I'm writing. However, when I try to use ThreadStart to do some work in a separate thread from my GUI, the methods Jason described don't seem to catch the exception. Take the following source code: Public Class...
1
47860
by: =?Utf-8?B?Wmlub24=?= | last post by:
Hello I have an ASP.NET 2 intranet application written in C#. I use Active Directory authentication and parts of the application uses AJAX. From time to time (about once every 200-300 accesses at least) I get the following error on the server: Event code: 3005 Event message: An unhandled exception has occurred.
0
10588
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10324
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
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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
6857
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
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.