Re: [xml] RelaxNG structured error reporting

Manuel González Castro <iinmgc00 ucv udc es> writes:


Daniel Veillard wrote:
Does it mean that Relax NG module doesn't support the new
structured error system? Am I missing something? 

  Yes, there is room in the Relax-NG validation context for
registering such an handler but no API for this yet.

Ok. Now I'm triying to get Relax NG errors using the old API but I've faced a strange problem. If I use the 
same handlers as xmllint:

  (xmlRelaxNGValidityErrorFunc) fprintf,
  (xmlRelaxNGValidityWarningFunc) fprintf,

  (xmlRelaxNGValidityErrorFunc) fprintf,
  (xmlRelaxNGValidityWarningFunc) fprintf,

Maybe you have different fprintf from the one libxml2 was compiled
with? Or you are doing something wrong.
then I don't get filename or line number information. But xmllint does, and there's a message posted by 
Petr Pajas a few days ago ( saying that 
setting xmlRelaxNGSetValidErrors error handlers to fprintf reported full information. I've debugged 
"xmllint --noout --relaxng test.rng test.xml" but I can't find what makes the difference.

Check the following lines at the end of __xmlRaiseError in error.c:

__xmlRaiseError(xmlStructuredErrorFunc schannel,
... snip ...

        (channel == xmlParserValidityError) ||
        (channel == xmlParserValidityWarning))
        xmlReportError(to, ctxt, str, NULL, NULL);
    else if ((channel == (xmlGenericErrorFunc) fprintf) ||
             (channel == xmlGenericErrorDefaultFunc))
        xmlReportError(to, ctxt, str, channel, data);
        channel(data, "%s", str);

-- Petr

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