473,493 Members | 4,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Parsing error opening XML file?!?!

Hi, all... Using VS.Net '03 (vb.net)...

I'm just entering a quick example from the KB, and getting an error right
away. Starting code below... When it hit the doc.Load line I get the error
"An Error occurred while parsing EntityName. line 4, position 28." XML File
contains all valid XML, no special characters or Unicode, etc...

Is there some trick here, or something missing from the samples (three
different samples in the KB use the same method to open an XML file)? Also
tried adding "Imports System.IO", but that didn't help...

Thanks,
Jack

' **********************************************
Imports System.XML
Imports System.Text

dim doc as XmlDocument = New XMLDocument()
doc.Load("c:\test.xml") <-- error here

Nov 21 '05 #1
2 7133
"Jack Black" <ja*************@hotmail.com> schrieb:
I'm just entering a quick example from the KB, and getting an error right
away. Starting code below... When it hit the doc.Load line I get the
error "An Error occurred while parsing EntityName. line 4, position 28."
XML File contains all valid XML, no special characters or Unicode, etc...


Can you post your XML file or parts of it?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2
Turned out to be a friggin' ampersand... *grr* Replaced "&" with "&amp;"
and all is right with the world again... :)

On a related note, how can I get an XML write to preserve carriage
return/line feeds? Tried enabling PreserveWhitespace property, but that
didn't help...

Jack
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"Jack Black" <ja*************@hotmail.com> schrieb:
I'm just entering a quick example from the KB, and getting an error right
away. Starting code below... When it hit the doc.Load line I get the
error "An Error occurred while parsing EntityName. line 4, position 28."
XML File contains all valid XML, no special characters or Unicode, etc...


Can you post your XML file or parts of it?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #3

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

Similar topics

2
3913
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
16
2849
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
8
2931
by: Eric Anderson | last post by:
I have some files that sit on a FTP server. These files contain data stored in a tab-separated format. I need to download these files and insert/update them in a MySQL database. My current basic...
5
1908
by: msammart | last post by:
Hey, i have a payroll system and i'm tyring to have it so the user can select an option from the menu and then be able to change one of the employee's salaries based on the user ID input. ( data is...
3
1690
by: CptDondo | last post by:
I am working on an embedded system. The entire configuration for the system is stored in an XML file, which is pretty long. It takes about 3 seconds to open the file using domxml_open_file. ...
2
1430
by: drjay | last post by:
I'm trying to get my script to parse a bunch of files and grab data between the <title></> and <blah></> tags. Yes yes, I'm parsing html with regex, it works though. :) The issue I have is...
9
4541
balabaster
by: balabaster | last post by:
I'm looking for some ideas regarding string parsing and brackets. Say I have the following string: 56*(73+23/(28+(7/14)-(3/2)) What would be the best way to parse the string for each opening...
3
4492
by: GazK | last post by:
I have been using an xml parsing script to parse a number of rss feeds and return relevant results to a database. The script has worked well for a couple of years, despite having very crude...
2
3594
by: Felipe De Bene | last post by:
I'm having problems parsing an HTML file with the following syntax : <TABLE cellspacing=0 cellpadding=0 ALIGN=CENTER BORDER=1 width='100%'> <TH BGCOLOR='#c0c0c0' Width='3%'>User ID</TH> <TH...
0
7157
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,...
0
7192
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...
1
6862
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...
1
4886
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...
0
4579
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...
0
3087
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
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 ...
0
282
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...

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.