Sorry, I inadvertently chopped off the tail of the message...

Yes, there is. You need to use the message handler hooks.

// callbacks to get error information from Sablotron and to prevent output
going to stderr.
extern "C" MH_ERROR
XSLTmakeCode (void *userData,
                  SablotHandle processor_,
                  int severity,
                  unsigned short facility,
                  unsigned short code)
{
        return code;
}

extern "C" MH_ERROR
XSLTerror (void *userData,
             SablotHandle processor_,
             MH_ERROR code,
             MH_LEVEL level,
             char **fields)
{
        // save away error message within instance

        // userData passed in corresponds to the class instance passed into
SablotRegister
        // save away the contents of fields in the class instance to keep
thread safe

        // fields is array of char pointers which is terminated with a NULL.
        return 0;
}

extern "C" MH_ERROR
XSLTlog (void *userData,
           SablotHandle processor_,
           MH_ERROR code,
           MH_LEVEL level,
           char **fields)
{
        // don't do anything with log messages - this method is a necessary
        // stub to capture errors using a MessageHandler.
        return code;
}

Reply via email to