[Xml-compile] (Abusing?) error handling in recent versions of
XML::Compile
Mark Overmeer
mark at overmeer.net
Wed Dec 10 19:48:32 GMT 2008
Hi Osfameron,
* Hakim Cassimally (hakim.cassimally at gmail.com) [081209 11:35]:
> We found that XML::Compile's error reporting at the time would quite
> easily lose information - so if a compile failed we'd only know that
> "an element" was declared with the wrong attribute, but not which
> one... grrrrr! Also compilation would stop immediately: we wanted to
> show *all* the errors to the caller, so that they can take action more
> easily.
Well, XML-Schemas are quite nasty. When it is possible to report
a good error without too much delay of the translation process, I
try to produce it... however, there are many situations where it only
seems that this is possible, but actually not is.
For instance, you can have choice, union or substitutionGroup with element
types where the differences only are a few levels deep (sometimes a
"fixed" attribute with a version number). When there are 50 choices,
each of them fails, where you expect one of those to succeed. Which one?
So: which of the 50 errors should I report?
For now, I have moved towards reporting related problems when in
debugging mode. So if you set:
use Log::Report mode => 'DEBUG';
you should be able to find the real cause of the problem.
> We obviously can't use the above code (some of the packages we're
> monkeypatching don't exist anyway even) and I'm sure that there must
> be a saner approach :-)
I did some renaming.
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the Xml-compile
mailing list