473,395 Members | 2,222 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.

XML Parsing errors

I've added a configuration file similar to Web.config but that does not
invoke a restart when changed, just a cache dependency.

At various times I'm getting a seeingly random one of the following
errors:

This is an unexpected token. The expected token is 'NAME'. Line 6,
position 3

An unexpected end of file parsing NAME has occurred. Line 6, position 3

The specified node cannot be inserted as the valid child of this node,
because the specified node is the wrong type.

My code is the straight forward

xmlDoc = new XmlDocument();
xmlDoc.Load(@"C:/Inetpub/AppConfig.xml");

I've checked the xml in XmlSpy and it's well formed so where's the
error? The xml is :

<?xml version="1.0" encoding="utf-8" ?>
<AppConfig>
<ModificationDate>14/06/2005</ModificationDate>
<SearchEngineList>
<SearchEngine>Googlebot</SearchEngine>
<SearchEngine>Lycos</SearchEngine>
<SearchEngine>Ultraseek</SearchEngine>
<SearchEngine>Sidewinder</SearchEngine>
<SearchEngine>InfoSeek</SearchEngine>
<SearchEngine>Scooter</SearchEngine>
<SearchEngine>WebCrawler</SearchEngine>
<SearchEngine>UTV</SearchEngine>
<SearchEngine>girafabot</SearchEngine>
<SearchEngine>WISEnutbot</SearchEngine>
<SearchEngine>MSIECrawler</SearchEngine>
<SearchEngine>msnbot</SearchEngine>
<SearchEngine>yahoo</SearchEngine>
<SearchEngine>teoma</SearchEngine>
<SearchEngine>Teoma</SearchEngine>
<SearchEngine>grub-client</SearchEngine>
<SearchEngine>iltrovatore</SearchEngine>
<SearchEngine>miragorobot</SearchEngine>
<SearchEngine>jetbot</SearchEngine>
<SearchEngine>ConveraCrawler</SearchEngine>
<SearchEngine>NutchCVS</SearchEngine>
<SearchEngine>sohu-search</SearchEngine>
<SearchEngine>aipbot</SearchEngine>
<SearchEngine>IRLbot</SearchEngine>
<SearchEngine>DTAAgent</SearchEngine>
<SearchEngine>NG/2.0</SearchEngine>
<SearchEngine>OmniExplorer_Bot</SearchEngine>
<SearchEngine>YellCrawl</SearchEngine>
<SearchEngine>LWP::Simple</SearchEngine>
<SearchEngine>Gigabot</SearchEngine>
<SearchEngine>MJ12bot</SearchEngine>
<SearchEngine>USyd-NLP-Spider</SearchEngine>
<SearchEngine>Baiduspider</SearchEngine>
<SearchEngine>EasyDL</SearchEngine>
<SearchEngine>Baiduspider</SearchEngine>
</SearchEngineList>
<IPAddressList>
<IPAddress>123.123.123.123</IPAddress>
</IPAddressList>
</AppConfig>

Nov 12 '05 #1
2 1848
I've since got the simultaneous errors of
The 'SearchEngine' start tag on line '13' doesn't match the end tag of
'' in file 'AppConfig.xml'. Line 13, position 28.
and
The 'SearchEngine' start tag on line '13' doesn't match the end tag of
'SearchEngineList' in file 'AppConfig.xml'. Line 42, position 4.

then shortly after
The 'SearchEngine' start tag on line '11' doesn't match the end tag of
'>' in file 'AppConfig.xml'. Line 11, position 29.
and
The 'SearchEngine' start tag on line '11' doesn't match the end tag of
'SearchEngineList' in file 'AppConfig.xml'. Line 41, position 4.
Also
The local name for elements or attributes cannot be null or an empty
string.

Am I missing something about the encoding or something? The whitespace
characters are just as in my previous post.

Nov 12 '05 #2

Chris wrote:
*I've since got the simultaneous errors of
The 'SearchEngine' start tag on line '13' doesn't match the end tag
of
'' in file 'AppConfig.xml'. Line 13, position 28.
and
The 'SearchEngine' start tag on line '13' doesn't match the end tag
of
'SearchEngineList' in file 'AppConfig.xml'. Line 42, position 4.

then shortly after
The 'SearchEngine' start tag on line '11' doesn't match the end tag
of
'>' in file 'AppConfig.xml'. Line 11, position 29.
and
The 'SearchEngine' start tag on line '11' doesn't match the end tag
of
'SearchEngineList' in file 'AppConfig.xml'. Line 41, position 4.
Also
The local name for elements or attributes cannot be null or an empty
string.

Am I missing something about the encoding or something? The
whitespace
characters are just as in my previous post. *


I struggled several days with a parsing error in xml-files in BizTalk.
The problem was that my editor, TextPad.exe, saves xml-files in
unicode, by default! A sample was generated from the schema, but after
I modified it, it stopped working! Very confusing.

--
Nils_Thorell
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1709335.html

Nov 12 '05 #3

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

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
0
by: Ewan B | last post by:
Hi, I'm using Xerces to parse XML files using SAX2, and am wondering if there is any information as to what exceptions are being thrown when certain validation errors occur. Taking a simple...
2
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
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...
19
by: asrs63 | last post by:
Hi, Is there a class that can handle splitting of a string on a comma such that the commas in quotes are ignored? I know we can use Text::ParseWords directive in perl to do this, but I am new...
0
by: gallagherg | last post by:
I recieve a Parsing returned error message 0x800700003 along with Actve x/com errors how can i stop this?
24
by: Marc Dubois | last post by:
hi, is it possible to parse an XML file in C so that i can fulfill these requirements : 1) replace all "<" and ">" signs inside the body of tag by a space, e.g. : Example 1: <fooblabla < bla...
26
by: Ramon F Herrera | last post by:
http://groups.google.com/group/comp.lang.c/browse_frm/thread/86a3ddf0724d9630/4e38340aa824bee0?lnk=gst&q=how+to+best+parse+a+CSV&rnum=1#4e38340aa824bee0 http://tinyurl.com/29q4kf Michael & Paul...
3
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...
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
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
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,...
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
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...
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,...

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.