[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [xml] Push parser bug



On Mon, Mar 12, 2001 at 07:57:09PM +0000, Matt Sergeant wrote:
> Using the push parser it won't accept any input with space at the
> beginning of the file. Witness:
> 
> $ xmllint --push -
> 
> <xml/>
> -:1: error: Extra spaces at the beginning of the document are not allowed
> <xml/>
> 
> ^

  Doohh .. something i fixed long ago in the other mode, 

    thanks for the report, patch enclosed,

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Index: parser.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/parser.c,v
retrieving revision 1.122
diff -c -r1.122 parser.c
*** parser.c	2001/03/07 19:45:40	1.122
--- parser.c	2001/03/12 20:51:20
***************
*** 7529,7552 ****
  	        /*
  		 * Very first chars read from the document flow.
  		 */
- 		cur = ctxt->input->cur[0];
- 		if (IS_BLANK(cur)) {
- 		    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
- 			ctxt->sax->setDocumentLocator(ctxt->userData,
- 						      &xmlDefaultSAXLocator);
- 		    ctxt->errNo = XML_ERR_DOCUMENT_START;
- 		    if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- 			ctxt->sax->error(ctxt->userData,
- 	    "Extra spaces at the beginning of the document are not allowed\n");
- 		    ctxt->wellFormed = 0;
- 		    ctxt->disableSAX = 1;
- 		    SKIP_BLANKS;
- 		    ret++;
- 		    if (ctxt->input->buf == NULL)
- 			avail = ctxt->input->length - (ctxt->input->cur - ctxt->input->base);
- 		    else
- 			avail = ctxt->input->buf->buffer->use - (ctxt->input->cur - ctxt->input->base);
- 		}
  		if (avail < 2)
  		    goto done;
  
--- 7529,7534 ----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]