Re: preferred implementation for error reporting
Robin Berjon <[email protected]> Fri, 11 Mar 2005 13:42:53 +0100
| Newsgroups | gmane.text.xml.relaxng.general |
|---|---|
| Message-ID | <[email protected]> |
Daniel Veillard wrote: > On Fri, Mar 11, 2005 at 12:25:27PM +0100, Robin Berjon wrote: >>So before I go hunting, is there an implementation of RNG that has >>precise error reporting? > > But in general due to the extreme flexibility of Relax-NG it is hard > to provide the "best" error report. This is mostly due to the choice > construct, all cases of a choice may fail, the algorithm will usually > report the error about only one of them, but which one is the "closest" > in content to the actual content is rather hard to tell, and well > for example my error report mechanism will complain about the last branch. > (snip) > So I don't have an answer, but I have a potential explanation :-) Yes, after asking here and some coffee, I thought about it some more and came to the same conclusion. In fact, testing with multiple implementations that take different approaches is probably one of the best ways of figuring out what's wrong :) In the case of the bug that I was having trouble tracking down it was due to user brain damage getting seriously in the way: I had groups of attributes pre-declared somewhere and filled in in other modules with combine=interleave and the pre-declaration content was notAllowed instead of empty so that it would never match. I guess only a rnglint could've helped there. That being said, maybe there's a way that implementations could report the pattern they were trying to match when failure occured (eventually with a trace)? It wouldn't be foolproof but when dealing with complex RNGs every little bit of information can help. Thanks! -- Robin Berjon Research Scientist Expway, http://expway.com/