[Mono-list] XSLT debugging ...

Michael Meeks michael.meeks at novell.com
Thu Nov 23 11:44:18 EST 2006


Hi guys,

	So - I have this (horribly complicated) zip + XSLT + C# application
with this much XSLT goodness:

resources> find -name '*.x??' | xargs cat  | wc -l
54915

	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 ].

	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 ].

	Is that an easy thing to hack up ? I started reading the XSLT processor
while tired last night, but to no avail :-)

	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.

	Thanks,

		Michael.

Call Template GetListStyleProperty params System.Collections.ArrayList
Call Template GetListProperty params System.Collections.ArrayList
Call Template GetListStyleProperty params System.Collections.ArrayList
[ERROR][/tmp/tst.docx] Conversion failed - Error during conversion
[DEBUG][/tmp/tst.docx] Operation is not valid due to the current state of the object(  at System.Collections.Stack.Pop () [0x00000] 
  at CleverAge.OdfConverter.OdfZipUtils.ZipArchiveWriter.WriteEndElement () [0x00000] 
  at CleverAge.OdfConverter.OdfZipUtils.ZipArchiveWriter.WriteFullEndElement () [0x00000] 
  at CleverAge.OdfConverter.OdfConverterLib.AbstractPostProcessor.WriteFullEndElement () [0x00000] 
  at Mono.Xml.Xsl.XmlWriterEmitter.WriteFullEndElement () [0x00000] 
  at Mono.Xml.Xsl.GenericOutputter.WriteEndElementInternal (Boolean fullEndElement) [0x00000] 
  at Mono.Xml.Xsl.GenericOutputter.WriteFullEndElement () [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslChoose.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.XslTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayLi
st withParams) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslApplyTemplates.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslChoose.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.XslTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayLi
st withParams) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslApplyTemplates.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.XslTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayLi
st withParams) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslApplyTemplates.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslChoose.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.XslTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayLi
st withParams) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslApplyTemplates.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.XslTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayLi
st withParams) [0x00000] 
  at Mono.Xml.Xsl.XslDefaultNodeTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayList withParams) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslApplyTemplates.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.XslTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.CallTemplate (System.Xml.XmlQualifiedName name, System.Collections.ArrayList withParams) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslCallTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslLiteralElement.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.Operations.XslTemplateContent.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p) [0x00000] 
  at Mono.Xml.Xsl.XslTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayLi
st withParams) [0x00000] 
  at Mono.Xml.Xsl.XslDefaultNodeTemplate.Evaluate (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.ApplyTemplates (System.Xml.XPath.XPathNodeIterator nodes, System.Xml.XmlQualifiedName mode, System.Collections.ArrayLi
st withParams) [0x00000] 
  at Mono.Xml.Xsl.XslTransformProcessor.Process (System.Xml.XPath.XPathNavigator root, Mono.Xml.Xsl.Outputter outputtter, System.Xml.Xsl.XsltArgumentList args
, System.Xml.XmlResolver resolver) [0x00000] 
  at System.Xml.Xsl.XslCompiledTransform.Transform (System.Xml.XPath.XPathNavigator input, System.Xml.Xsl.XsltArgumentList args, System.Xml.XmlWriter output, 
System.Xml.XmlResolver resolver) [0x00000] 
  at System.Xml.Xsl.XslCompiledTransform.Transform (System.Xml.XmlReader input, System.Xml.Xsl.XsltArgumentList args, System.Xml.XmlWriter output, System.Xml.
XmlResolver resolver) [0x00000] 
  at CleverAge.OdfConverter.OdfConverterLib.Converter.Transform (System.String inputFile, System.String outputFile) [0x00000] 
  at CleverAge.OdfConverter.CommandLineTool.OdfConverterTest.ConvertFile (System.String input, System.String output, Boolean isDirectTransform) [0x00000] )
Done.


-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot




More information about the Mono-list mailing list