diff -ru libxml2-2.6.32/parser.c libxml2-2.6.32+iPhone/parser.c --- libxml2-2.6.32/parser.c 2008-04-08 14:47:58.000000000 +0000 +++ libxml2-2.6.32+iPhone/parser.c 2008-08-28 07:30:34.000000000 +0000 @@ -10003,7 +10003,7 @@ xmlParseGetLasts(ctxt, &lastlt, &lastgt); while (1) { - if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1)) + if ((ctxt->wellFormed != 1) && (ctxt->disableSAX == 1)) return(0); @@ -10881,7 +10881,7 @@ if (ctxt == NULL) return(XML_ERR_INTERNAL_ERROR); - if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1)) + if ((ctxt->wellFormed != 1) && (ctxt->disableSAX == 1)) return(ctxt->errNo); if (ctxt->instate == XML_PARSER_START) xmlDetectSAX2(ctxt); @@ -10932,7 +10932,7 @@ (ctxt->input->buf != NULL)) { xmlParserInputBufferPush(ctxt->input->buf, 1, "\r"); } - if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1)) + if ((ctxt->wellFormed != 1) && (ctxt->disableSAX == 1)) return(ctxt->errNo); if (terminate) { /* @@ -10962,6 +10962,7 @@ } ctxt->instate = XML_PARSER_EOF; } + if (ctxt->wellFormed) return(0); return((xmlParserErrors) ctxt->errNo); }