473,395 Members | 1,495 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,395 software developers and data experts.

Problem with XmlDocument

NN
Before that nothing I want to ask for excuses for my english level.

The problem that I have is the following one:

I have a file xml with "encoding=ISO-8859-1" and accents.

When in VB.NET, in a Form I write:

Dim objxml as new XmlDocument

and then when de Forms load:

objxml.Load("C\....")

The debugger gives me the following error:

"A first chance exception of type 'System.ArgumentsException' occurred in
mscorlib.dll"

"Additional information: Not valid byte in the index byte 1143"

1143 is where the accent is.

Someone can help me?
Feb 28 '06 #1
2 1962
Hello, NN!

N> The problem that I have is the following one:

N> I have a file xml with "encoding=ISO-8859-1" and accents.

N> When in VB.NET, in a Form I write:

N> Dim objxml as new XmlDocument

N> and then when de Forms load:

N> objxml.Load("C\....")

N> The debugger gives me the following error:

N> "A first chance exception of type 'System.ArgumentsException' occurred
N> in mscorlib.dll"

N> "Additional information: Not valid byte in the index byte 1143"

N> 1143 is where the accent is.

Are you sure that xml indeed has the encoding you specified?

You can try to preconvert it first.
string xml = Encoding.GetEncoding("ISO-8859-1").GetString(File.ReadAllBytes("c:\...."));
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 28 '06 #2

You might want to escape the accent symbol or replace it with a special
entity

( Example, & becomes & )

NN wrote:
Before that nothing I want to ask for excuses for my english level.

The problem that I have is the following one:

I have a file xml with "encoding=ISO-8859-1" and accents.

When in VB.NET, in a Form I write:

Dim objxml as new XmlDocument

and then when de Forms load:

objxml.Load("C\....")

The debugger gives me the following error:

"A first chance exception of type 'System.ArgumentsException' occurred in
mscorlib.dll"

"Additional information: Not valid byte in the index byte 1143"

1143 is where the accent is.

Someone can help me?

Feb 28 '06 #3

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

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...
3
by: binnyva | last post by:
Hi everyone. I just made a JavaScript program to read a RSS feeds and display it in a HTML file. The script - Jasfer or JAvaScript FEed Reader - is available at...
1
by: Shawn | last post by:
Hi. I'm using a FileStream (instead of just the path to the xml file) to load an XmlDocument. I'm doing this because I need to be able to prevent other processes to update the file I'm working on....
4
by: Gismo | last post by:
I have got file raport.rld which is an XML file generated by MS Reporting Services. The problem is: in this file are tags from two different namespaces ...
1
by: nibble | last post by:
I'm doign the following: XmlElement myElem....; string name = "xmlns:"+"abc"; string value = "http://www.abc.com"; myElem.SetAttribute(name, value); I get an exception saying that name...
4
by: Cedric | last post by:
Hi, I have a function from one component that returns an XmlDocument object. I have another function in another component that takes an XmlDocument as a property. I have written an XSLT to...
1
by: Hans [DiaGraphIT] | last post by:
Hi! I have problem with passing data to custom action. I don't know what wrong I'm doing. I'm trying to follow the steps in the walkthrough: "Passing Data to a Custom Action" ...
1
by: Joe | last post by:
I want to save some URLs into a XML formatted document. > > I find out that its having some problems due to some of the characters > used > in the URL. > > Is there a quick way to get around...
1
by: John Wilhelm | last post by:
I'm having a problem in by VB.net 2005 application. When i try to get a node from my app.config file the node come back with "nothing". The xmldocment loads OK, but I can't retrive a node. The...
1
by: danep | last post by:
Hi, I'm fairly new to AJAX, but I've been able to retrieve HTML and plain-text documents without any trouble. However, I haven't figured out how to retrieve it in XML format. Basically, here's...
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?
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
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...
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,...

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.