472,949 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,949 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 1831
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

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.