[Mono-dev] Possible bug in xslt extension object
Miguel de Icaza
miguel at novell.com
Tue Aug 21 11:43:27 EDT 2007
Hello,
As usual, please file a bug report. That way we can properly
follow up on it.
> Hi there,
>
> While building an XmlTransformation class that can embed external objects into the xsl transformation process via System.Xml.Xsl.XsltArgumentList I've hit a possible bug in the mono stack. I've attached a test program, a text xsl file and a test xml document. Running the program under mono 1.2.5 (/trunk/ r84242) (the program was compiled with Mono C# compiler version 1.2.5.0) with --debug gives me:
>
> Unhandled Exception: System.Xml.Xsl.XsltException: Custom function reported an error. ---> System.InvalidCastException: Cannot cast from source type to destination type.
> at Mono.Xml.Xsl.XsltExtensionFunction.Invoke (Mono.Xml.Xsl.XsltCompiledContext xsltContext, System.Object[] args, System.Xml.XPath.XPathNavigator docContext) [0x00000] --- End of inner exception stack trace ---
>
> at Mono.Xml.Xsl.XsltExtensionFunction.Invoke (Mono.Xml.Xsl.XsltCompiledContext xsltContext, System.Object[] args, System.Xml.XPath.XPathNavigator docContext) [0x00000]
> at Mono.Xml.Xsl.XPFuncImpl.Invoke (System.Xml.Xsl.XsltContext xsltContext, System.Object[] args, System.Xml.XPath.XPathNavigator docContext) [0x00000]
> at System.Xml.XPath.ExprFunctionCall.Evaluate (System.Xml.XPath.BaseIterator iter) [0x00000]
> at System.Xml.XPath.Expression.EvaluateString (System.Xml.XPath.BaseIterator iter) [0x00000]
> at System.Xml.XPath.CompiledExpression.EvaluateString (System.Xml.XPath.BaseIterator iter) [0x00000]
> at System.Xml.XPath.XPathNavigator.EvaluateString (System.Xml.XPath.XPathExpression expr, System.Xml.XPath.XPathNodeIterator context, IXmlNamespaceResolver ctx) [0x00000]
> at Mono.Xml.Xsl.XslTransformProcessor.EvaluateString (System.Xml.XPath.XPathExpression expr) [0x00000]
> at Mono.Xml.Xsl.Operations.XslValueOf.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.EvaluateCore (Mono.Xml.Xsl.XslTransformProcessor p, System.Collections.Hashtable withParams) [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.ArrayList 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.XslTransform.Transform (System.Xml.XPath.XPathNavigator input, System.Xml.Xsl.XsltArgumentList args, System.Xml.XmlWriter output, System.Xml.XmlResolver resolver) [0x00000]
> at System.Xml.Xsl.XslTransform.Transform (IXPathNavigable input, System.Xml.Xsl.XsltArgumentList args, System.Xml.XmlWriter output, System.Xml.XmlResolver resolver) [0x00000]
> at XmlTransformExtObj.Transform (System.String stylesheetfilename, System.String inxml) [0x00000]
> at XmlTransformExtObj.Main (System.String[] args) [0x00000]
>
> running the program under Microsoft Windows .Net Framework v2.0.50727 (the program was compiled with Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42) gives me:
>
> 210297.Net for monkeys must be returned now!
> .Net for goldfish must be returned now!
>
> ...as was expected.
>
> The complete --trace=all output is not attached, as is amounts to 44 Mb. But it can, off course, be made available at request.
>
> Also, I could not help to notice the following - commented - line of code where the exception is thrown in XslFunctions.cs:
> // Debug.WriteLine ("****** INCORRECT RESOLUTION **********");
>
> If more information is needed, please do not hesitate to write me.
>
> Best regards,
> Steen Manniche,
> Programmer,
> Danish Bibliographic Centre,
> Tempovej 7-11,
> DK-2750 Ballerup
>
> Phone: +45 44 86 78 75
> _______________________________________________ Mono-devel-list mailing list Mono-devel-list at lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list