[xml] Why structured error callback registered on sax handler be called to raise schema validation error?



Hi

We use xmlSchemaValidateStream() function to validate an input based on a flow of SAX event from the parser.

When some validation error occurs, to raise that error subsequently __xmlRaiseError() is called by the libxml.

But for the schema validation error the structured error callback registered on the sax handler

is not called because of the following piece of code in __xmlRaiseError () controlling the call

if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||

        (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||

       (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {

       ctxt = (xmlParserCtxtPtr) ctx;

       if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&

           (ctxt->sax->initialized == XML_SAX2_MAGIC))

           schannel = ctxt->sax->serror;

    }

   

For a schema validation error this domain is XML_FROM_SCHEMASV.

My question is why for the schema validation errors we can't call the structured error callback registered on the SAX Handler?

Thanks and Regards

        Rabi

 

 



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