You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gus Delgado <gu...@netquotient.com> on 2001/06/11 15:02:49 UTC

unsubscribe me

unsubscribe me

-----Original Message-----
From: Glenn Marcy [mailto:gmarcy@us.ibm.com]
Sent: Saturday, June 09, 2001 9:28 AM
To: xerces-j-dev@xml.apache.org
Subject: Re: Bug with XMLDocumentScanner.java (fix provided) (xerces
1.4.0, 1.3.1, 1.3.0)




Luke,

The XMLDecl, i.e. <?xml version="1.0"?>, if present in the document, is
required by the
XML specification to appear and only appear starting at the very first byte
of the document.
The "XML document" that you are trying to parse is not well-formed and
Xerces is correctly
failing to parse this document.  This is not a bug and your suggested "fix"
is inappropriate
and should not be applied.

You should pass this on to whoever sent you such a document so that they
may fix this
in any other documents with this problem.

Regards,
Glenn



lchen@parasoft.com (Luke Chen) on 06/08/2001 08:43:25 PM

Please respond to xerces-j-dev@xml.apache.org

To:   "Xerces-J-Dev@Xml. Apache. Org" <xe...@xml.apache.org>
cc:
Subject:  Bug with XMLDocumentScanner.java (fix provided) (xerces 1.4.0,
      1.3.1, 1.3.0)



Currently, the when using a SAX Parser parsing an XML file which starts
with
a whitespace
before the <?xml version="1.0"?> declaration, the parsing stops.  I found a
fix
by adding a call to XMLEntityHandler.EntityReader.skipPastSpaces()to the
final classes XMLDeclDispatcher and PrologDispatcher to look like:

   final class PrologDispatcher implements ScannerDispatcher {
        public boolean dispatch(boolean keepgoing) throws Exception {
            fEntityReader.skipPastSpaces();
            do {
               .....code continues.

and
  final class XMLDeclDispatcher implements ScannerDispatcher {
        public boolean dispatch(boolean keepgoing) throws Exception {
            fEventHandler.callStartDocument();
            fEntityReader.skipPastSpaces();
            if (fEntityReader.lookingAtChar('<', true)) {

              ........  code continues here


This seems to fix the problems.

Luke Chen               email: lchen@parasoft.com
Parasoft Corporation    voice:(626) 256-3680 x 1217
2031 S. Myrtle          fax:  (626) 305-9048
Monrovia, CA 91016


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org