473,399 Members | 3,888 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,399 software developers and data experts.

XmlException

I am using the XmlReader to look at some xml data fragments.

Many times the xml fragment is not readable by the XmlReader, since it isn't
valid.
For example, I may be looking at only the text </MyXmlNode>.
If I try to read this, I get an exception because it is a closing node with
no opening node.

My problem is that there is no way for me to know what the exception is.
The only exception that is thrown is "XmlException" which does not have a
public ErrorCode property, or anything else that I can look at.

There is a Message property, but that is pretty much useless to me.
I have other exceptions that are thrown, like Nodes that have invalid ( non
printable ) characters. Again, all I know is that there was a problem. No
information on what the problem might have been.

Is there another way to do this so that I can intelligently fix the problem
and try to re-read the Node?

Thanks
Jeff
Nov 16 '05 #1
1 1789
Obviously this is a bug.
Does anyone have any idea if this is going to be fixed in the future?

Jeff

"news.microsoft.com" <hi@hi.com> wrote in message
news:O$**************@TK2MSFTNGP09.phx.gbl...
I am using the XmlReader to look at some xml data fragments.

Many times the xml fragment is not readable by the XmlReader, since it isn't valid.
For example, I may be looking at only the text </MyXmlNode>.
If I try to read this, I get an exception because it is a closing node with no opening node.

My problem is that there is no way for me to know what the exception is.
The only exception that is thrown is "XmlException" which does not have a
public ErrorCode property, or anything else that I can look at.

There is a Message property, but that is pretty much useless to me.
I have other exceptions that are thrown, like Nodes that have invalid ( non printable ) characters. Again, all I know is that there was a problem. No information on what the problem might have been.

Is there another way to do this so that I can intelligently fix the problem and try to re-read the Node?

Thanks
Jeff

Nov 16 '05 #2

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

Similar topics

1
by: Koji Ishii | last post by:
I'm trying to read response from a web server using XmlTextReader. Here's a code snippet. WebResponse rs = this.WebRequest.GetResponse(); Stream stm = rs.GetResponseStream(); XmlTextReader...
0
by: George CK | last post by:
Hello, I tried to send an xml string got from XmlTextReader from a web service proxy to a web service. The type of the web method is simply "string" It's fine when the string length was small...
3
by: Todd | last post by:
Our ASP.NET (C#) application accepts form entry and saves inputed data in XML. We are finding that users are sometimes cutting and pasting special characters (from MS Word) into these forms....
1
by: George W. | last post by:
When attempting to validate an XML file, If the file is valid, it validates correctly, and it will catch most ValidationEvents without problem. However, I keep getting the following Exception:...
1
by: edi | last post by:
Hi, I have MS .Net Framework v1.1.4322. I have this XML file: <?xml version="1.0" ?> <!--here there are two spaces at the beginning--> <aaa> <a id="1"> <Dept>Finance</Dept>
0
by: Franck | last post by:
Hello, here is my basic dtd <!ELEMENT TREENODES (treenode*)> <!ELEMENT treenode (treenode*)> <!ATTLIST treenode Text (#PCDATA) #REQUIRED Level (#PCDATA) #REQUIRED NodeData (#PCDATA) ...
0
by: Frederico Guimar?es via DotNetMonster.com | last post by:
Hi, I'm trying to use the Microsoft.Web.Services2.Messaging. ISoapFormatter but I receive this error: System.Xml.XmlException: The root element is missing. at System.Xml.XmlTextReader.Read()...
1
by: BLUE | last post by:
In a property i do this: .... catch(XmlException e) { throw new XmlException("Error processing configuration file!",e); } Then I catch it in another class: catch(XmlException e) {
3
by: =?Utf-8?B?RWQgS3JhbWVy?= | last post by:
I thought this might be useful for someone... I was doing a little work earlier using an Xmldocument class to create & maintain a minor store of data in Xml format. I'd gotten the whole thing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.