473,326 Members | 2,048 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 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 1956
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: 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
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.