[Mono-list] XSLT debugging ...
atsushi at ximian.com
Thu Nov 23 23:36:13 EST 2006
> And of course, since there is -at-least- 1 bug somewhere in it,
> everything blows up, and I get these beautiful exception stacks (one of
> which I append for your pleasure) :-) [ of course the bug may be in the
> template processor too, hard to say, allegedly it works on Win32 ;-) ].
> So - my question is - how do people debug 55k lines of XSLT ? :-) and -
> more to the point, when something fails how do we get a decent 'stack
> trace' from the XSLT code ? [ I tried adding some 'Call Template'
> tracing debug - as you see, but quickly get swamped ].
People doesn't debug XSLT in such way. People just reduce extra
transformation parts, reduce imputs and trim down to doubtful blocks.
(BTW it is exactly the same as how people file bugs on bugzilla.)
> What I would -love- would be a simple piece of code that just dumped
> the file/line information to the console (or Debug. or whatever) and
> re-threw the exception, perhaps in 'XslTemplate.Evaluate' or something
> (?) [ we get a good number of frames of that ].
In such case you could just use mono-xmltool to debug your XSLT.
Or just wrap around the entire transformation with "try" and "catch
XsltException", and get LineNumber and LinePosition from there.
Actually its Message property indicates them, so you don't have to
retrieve those numbers.
> The code is at: https://svn.sf.net/svnroot/odf-converter/trunk but
> while it's appreciated, I'd prefer to improve Mono's diagnostics than
> the XSLT itself.
Any omitted information wouldn't result in better debugging. That is not
what we call "good diagnostics".
Have a nice weekend,
More information about the Mono-list