The error occurs when I use the progressive parse functionality of the SAX parser. If you run the PParse sample, you never get an error stating that the document is empty, although SAXCount and SAXPrint, which does not use progressive parsing, gives you the appropriate error. I do have an error handler installed.
In my application, when the prolog is parsed using parseFirst(), I don't get GotMore = 0, rather, GotMore = 1. So, the empty file is never detected when the prolog is parsed.
The application then calls parseNext() which sets GotMore = 0, becauser there is no more data. However, no EOF switch is set and no error is thrown. Please look at your scanFirst() and scanNext() methods which returns no error when a blank character is found. Here is the file I used.
<<gui3.xml>>
Thanks
-----Original Message-----
From: Peter A. Volchek [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 9:21 AM
To: [EMAIL PROTECTED]
Subject: Re: parsing an empty xml file
The Xerces reports an error�if an input file is empty�since the earliest versions. (I remember that I checked it, because an XML4C did not report it)
I also tried DOMPrint with empty xml file passed as argument, and got expected error output (like one got by Tinny)
�
Williamson,
could you explain in more detail your phrase?
��� >then I don't get an >error back and Xerces is locked up.= Please help.
�
Could you also provide a piece of code, that caused you troubles?
�
Peter A. Volchek
�
----- Original Message -----
From: Williamson, Siehnai <mailto:[EMAIL PROTECTED]>
To: '[EMAIL PROTECTED]' <mailto:'[EMAIL PROTECTED]'>
Sent: Tuesday, December 11, 2001 17:08
Subject: RE: parsing an empty xml file
I am using Xerces 1.4 on the Win98 platform.� I am using the SAX parser.
-----Original Message-----
From:�� Tinny Ng [SMTP:[EMAIL PROTECTED]]
Sent:�� Tuesday, December 11, 2001 8:14 AM
To:���� [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Subject:������� Re: parsing an empty xml file
Which platform and which version of Xerces-C++ are you using?= I tried Xerces-C++ 1.6 on a number of platforms (linux, solaris, aix, hp, windows) and able to get the following message:
=> DOMCount empty.xml
Fatal Error at file /home/tng/buildtest/xerces-c_2001-11-29-AIX43_5.02/bin/empty.xml, line 2, char 1
= Message: The main XML document cannot be empty
Errors occured, no output available
Tinny
"Williamson, Siehnai" wrote:
=
Hi Guys,
Currently, if I attempt to parse an xml file which is empty (no tags, nothing), then I don't get an error back and Xerces is locked up.= Please help.
Thanks
gui3.xml
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
