473,788 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=I SO-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.Argumen tsException' 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 1997
Hello, NN!

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

N> I have a file xml with "encoding=I SO-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.Argumen tsException' 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.GetEnc oding("ISO-8859-1").GetString(F ile.ReadAllByte s("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=I SO-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.Argumen tsException' 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
8718
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 System.IO.StringReader(node.InnerText); xdoc.Load(sr);
3
25430
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 http://www.geocities.com/binnyva/code/javascript/jasfer/ The problem that I have is that this script works only in IE. The XML reading part goes fine - but I don't know how to access the DOM sturcture in Firefox. The used code is given below.
1
6824
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. The problem is that I'm getting multiple processing instructions and multiple root elements in my xml file when I use a FileStream. Here is an example: test_1.xml contains: <?xml version="1.0" encoding="utf-8"?> <root>
4
8978
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 xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini tion" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"
1
3536
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 cannot have ':' in it. However, MSDN usage doc for this method explicitly says that ':' will be parsed and the prefix would be retrieved.
4
1662
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 transform the Xml from the first function to the format expected by the second function. But I don't see how I can call the tranformation process in .NET 2.0. It says that I have to use the XslCompiledTransform class in .NET 2.0, but the transform...
1
5355
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" http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkwalkthroughpassingdatatocustomaction.asp The error I recieve is: "The savedSate dictionary does not contain the expected values and might
1
1489
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 that? Thanks. > > Here are some of the URL characters in the parameters >
1
2899
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 app.config file is listed below and the code is listed below that, the line with "-->>" is where i try to get the node. Can anyone see where I'm going wrong. A dump of the xmlDocument is listed below the code. Note: "MyKey" is set to "Reports"
1
2077
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 the script that's supposed to retrieve and parse the data when you pass it the url of the page generating the XML data: <script type="text/javascript"> var xmlHttp function getresponse(url)
0
9498
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
10110
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
9967
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
8993
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...
1
7517
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
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
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.