2003-05-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 28 May 2003 14:55:46 +0000 (14:55 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 28 May 2003 14:55:46 +0000 (14:55 -0000)
* XslTransform.cs: fixed NullReferenceExceptions after the last
change (which, btw, should have included a ChangeLog entry).

svn path=/trunk/mcs/; revision=14970

mcs/class/System.XML/System.Xml.Xsl/ChangeLog
mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs

index 9d225f5160e177d598cedff3a0b19b6b0a5e3df2..b5083fd420b083aac838d8058692032edda96076 100644 (file)
@@ -1,4 +1,10 @@
+2003-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * XslTransform.cs: fixed NullReferenceExceptions after the last
+       change (which, btw, should have included a ChangeLog entry).
+
 2003-05-27  Ben Maurer <bmaurer@users.sourceforge.net>
+
        * XslTransform.cs: unsafe classes need unsafe!
 
 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
index f910e7596e3951c5a0e96e9847c5678f3826e687..567d3802bc80736f116d6796ee97de4cd49789d4 100644 (file)
@@ -9,10 +9,11 @@
 //\r
 \r
 using System;\r
-using System.Xml.XPath;\r
+using System.Collections;\r
 using System.IO;\r
 using System.Text;\r
 using System.Runtime.InteropServices;\r
+using System.Xml.XPath;\r
 \r
 using BF = System.Reflection.BindingFlags;\r
 \r
@@ -199,7 +200,7 @@ namespace System.Xml.Xsl
                        }\r
                }\r
 \r
-               IntPtr ApplyStylesheet (IntPtr doc, string[] argArr, System.Collections.Hashtable extobjects)\r
+               IntPtr ApplyStylesheet (IntPtr doc, string[] argArr, Hashtable extobjects)\r
                {\r
                        if (stylesheet == IntPtr.Zero)\r
                                throw new XmlException ("No style sheet!");\r
@@ -234,7 +235,7 @@ namespace System.Xml.Xsl
                                                        methods = type.GetMethods();\r
                                                }\r
 \r
-                                               System.Collections.Hashtable alreadyadded = new System.Collections.Hashtable();\r
+                                               Hashtable alreadyadded = new Hashtable ();\r
                                                foreach (System.Reflection.MethodInfo mi in methods) {\r
                                                        if (alreadyadded.ContainsKey(mi.Name)) continue; // don't add twice\r
                                                        alreadyadded[mi.Name] = 1;\r
@@ -292,7 +293,7 @@ namespace System.Xml.Xsl
                        return result.ReadToEnd ();\r
                }\r
 \r
-               string ApplyStylesheetAndGetString (IntPtr doc, string[] argArr, System.Collections.Hashtable extobjects)\r
+               string ApplyStylesheetAndGetString (IntPtr doc, string[] argArr, Hashtable extobjects)\r
                {\r
                        IntPtr xmlOutput = ApplyStylesheet (doc, argArr, extobjects);\r
                        string strOutput = GetStringFromDocument (xmlOutput);\r
@@ -319,7 +320,9 @@ namespace System.Xml.Xsl
                {\r
                        IntPtr xmlInput = GetDocumentFromNavigator (input);\r
                        string[] argArr = null;\r
+                       Hashtable extensionObjects = null;\r
                        if (args != null) {\r
+                               extensionObjects = args.extensionObjects;\r
                                argArr = new string[args.parameters.Count * 2 + 1];\r
                                int index = 0;\r
                                foreach (object key in args.parameters.Keys) {\r
@@ -334,7 +337,7 @@ namespace System.Xml.Xsl
                                }\r
                                argArr[index] = null;\r
                        }\r
-                       string xslOutputString = ApplyStylesheetAndGetString (xmlInput, argArr, args.extensionObjects);\r
+                       string xslOutputString = ApplyStylesheetAndGetString (xmlInput, argArr, extensionObjects);\r
                        xmlFreeDoc (xmlInput);\r
                        Cleanup ();\r
 \r
@@ -391,7 +394,9 @@ namespace System.Xml.Xsl
 \r
                        IntPtr inputDoc = GetDocumentFromNavigator (input);\r
                        string[] argArr = null;\r
+                       Hashtable extensionObjects = null;\r
                         if (args != null) {\r
+                               extensionObjects = args.extensionObjects;\r
                                argArr = new string[args.parameters.Count * 2 + 1];\r
                                int index = 0;\r
                                foreach (object key in args.parameters.Keys) {\r
@@ -406,7 +411,7 @@ namespace System.Xml.Xsl
                                }\r
                                argArr[index] = null;\r
                        }\r
-                       string transform = ApplyStylesheetAndGetString (inputDoc, argArr, args.extensionObjects);\r
+                       string transform = ApplyStylesheetAndGetString (inputDoc, argArr, extensionObjects);\r
                        xmlFreeDoc (inputDoc);\r
                        Cleanup ();\r
                        output.Write (transform);\r