[Mono-dev] Cosmetic fix for XslTranslate

Andrew Skiba andrews at mainsoft.com
Wed Nov 2 08:42:48 EST 2005

Hi Eno,

I saw in one of the overloads there is a check that stylesheet was
loaded, and in the other there is no such check, so instead of
XsltException there will be NullPointerException. Please review the
patch to fix it.


Index: XslTransform.cs
--- XslTransform.cs	(revision 52469)
+++ XslTransform.cs	(working copy)
@@ -192,6 +192,9 @@
 		void Transform (XPathNavigator input, XsltArgumentList
args, TextWriter output, XmlResolver resolver)
+			if (s == null)
+				throw new XsltException ("No stylesheet
was loaded.", null);
 			Outputter outputter = new
GenericOutputter(output, s.Outputs, output.Encoding);			
 			new XslTransformProcessor (s).Process (input,
outputter, args, resolver);
 			outputter.Done ();

More information about the Mono-devel-list mailing list