You may use the message handler. See shandler.h for more details.
Perl module XML::Sablotron may serve as a good code example, although it
is a bit confusing. :)
Pavel
Sam Brauer wrote:
> I'm trying to figure out how to programatically access error messages
> produced by the Sablotron engine.
> It seems that by default if there is a parse or transformation error, a
> message (such as: "Error [code:2] [URI:arg:/_stylesheet] [line:45]
> XML parser error 7: mismatched tag") goes to stderr.
>
> Is there any way for calling code to get access to these messages (for
> instance, to present them to the end-user of an application that uses the
> Sablotron library)?
>
> If there is no current functionality to do so, might it be possible to add
> another argument to the SablotProcess* functions that points to the error
> message (if any) if the return value is non-zero?
>
> For example:
> int SablotProcessStrings(char *styleSheetStr,
> char *inputStr,
> char **resultStr,
> char **errorStr) // new argument
>
> So calling code could call SablotProcessStrings() as usual.
> If it returns non-zero, instead of retrieving the transformation
> output by looking at the data pointed to by resultStr, it could retrieve
> the error message by looking at the data pointed to by errorStr.
> There would also need to be a new function to allow calling code to free
> the memory that was allocated for the error message.
>
> Thank you,
> Sam
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Sam Brauer : Systems Programmer : [EMAIL PROTECTED]