View | Details | Raw Unified | Return to bug 24379
Collapse All | Expand All

(-)a/error.c (-22 / +12 lines)
Lines 459-466 __xmlRaiseError(xmlStructuredErrorFunc schannel, Link Here
459
	(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
459
	(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
460
	ctxt = (xmlParserCtxtPtr) ctx;
460
	ctxt = (xmlParserCtxtPtr) ctx;
461
	if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&
461
	if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&
462
	    (ctxt->sax->initialized == XML_SAX2_MAGIC))
462
	    (ctxt->sax->initialized == XML_SAX2_MAGIC)) {
463
	    schannel = ctxt->sax->serror;
463
	    schannel = ctxt->sax->serror;
464
	    if (schannel)
465
	       data = ctxt->userData;
466
	}
464
    }
467
    }
465
    /*
468
    /*
466
     * Check if structured error handler set
469
     * Check if structured error handler set
Lines 473-486 __xmlRaiseError(xmlStructuredErrorFunc schannel, Link Here
473
	if (schannel != NULL)
476
	if (schannel != NULL)
474
	    data = xmlStructuredErrorContext;
477
	    data = xmlStructuredErrorContext;
475
    }
478
    }
476
    if ((domain == XML_FROM_VALID) &&
477
        ((channel == xmlParserValidityError) ||
478
	 (channel == xmlParserValidityWarning))) {
479
	ctxt = (xmlParserCtxtPtr) ctx;
480
	if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&
481
	    (ctxt->sax->initialized == XML_SAX2_MAGIC))
482
	    schannel = ctxt->sax->serror;
483
    }
484
    if (code == XML_ERR_OK)
479
    if (code == XML_ERR_OK)
485
        return;
480
        return;
486
    /*
481
    /*
Lines 589-594 __xmlRaiseError(xmlStructuredErrorFunc schannel, Link Here
589
    if (to != &xmlLastError)
584
    if (to != &xmlLastError)
590
        xmlCopyError(to,&xmlLastError);
585
        xmlCopyError(to,&xmlLastError);
591
586
587
    if (schannel != NULL) {
588
        schannel(data, to);
589
	return;
590
    }
591
592
    /*
592
    /*
593
     * Find the callback channel if channel param is NULL
593
     * Find the callback channel if channel param is NULL
594
     */
594
     */
Lines 600-618 __xmlRaiseError(xmlStructuredErrorFunc schannel, Link Here
600
	    channel = ctxt->sax->error;
600
	    channel = ctxt->sax->error;
601
	data = ctxt->userData;
601
	data = ctxt->userData;
602
    } else if (channel == NULL) {
602
    } else if (channel == NULL) {
603
        if ((schannel == NULL) && (xmlStructuredError != NULL)) {
603
        channel = xmlGenericError;
604
	    schannel = xmlStructuredError;
604
	if (!data)
605
	    data = xmlStructuredErrorContext;
605
	   data = xmlGenericErrorContext;
606
	} else {
607
	    channel = xmlGenericError;
608
	    if (!data) {
609
		data = xmlGenericErrorContext;
610
	    }
611
	}
612
    }
613
    if (schannel != NULL) {
614
        schannel(data, to);
615
	return;
616
    }
606
    }
617
    if (channel == NULL)
607
    if (channel == NULL)
618
        return;
608
        return;

Return to bug 24379