Pārlūkot izejas kodu

2005-02-24 Atsushi Enomoto <[email protected]>

	* XslTransformImpl.cs : Load() should use argument XmlResolver to
	  get file stream. This fixes bug #72942.
	* BUGS-MS.txt : more bug info.


svn path=/trunk/mcs/; revision=41138
Atsushi Eno 21 gadi atpakaļ
vecāks
revīzija
b85ce84bcb

+ 7 - 2
mcs/class/System.XML/System.Xml.Xsl/BUGS-MS.txt

@@ -39,8 +39,7 @@ No. 0006
 	(Text_78308, Text_78311, modified_78308, modified_78309,
 	modified_78311, output_output03, output_output06, output_output08,
 	output_output46, output_output61, output_output62,
-	output_output74, output_output75,
-	)
+	output_output74, output_output75)
 
 No. 0007
 	cdata-section-elements is not working when XmlWriter is specified as
@@ -49,10 +48,16 @@ No. 0007
 	output_output87, output_output88, output_output91 - output_output98,
 	output_output101 - output_output107).
 
+No. 0008
+	template "match" attribute does not allow variable reference.
+	(match_match14)
+
+
 Not sure the reason why:
 	From mdocs_mdocs01 to mdocs_mdocs18
 	whitespace_whitespace35
 
+
 Notes:
 
 1. Roman numbering

+ 6 - 0
mcs/class/System.XML/System.Xml.Xsl/ChangeLog

@@ -1,3 +1,9 @@
+2005-02-24  Atsushi Enomoto  <[email protected]>
+
+	* XslTransformImpl.cs : Load() should use argument XmlResolver to
+	  get file stream. This fixes bug #72942.
+	* BUGS-MS.txt : more bug info.
+
 2005-02-23  Atsushi Enomoto  <[email protected]>
 
 	* BUGS-MS.txt : all output_outputXXX comparison does not make sense.

+ 16 - 4
mcs/class/System.XML/System.Xml.Xsl/XslTransformImpl.cs

@@ -36,12 +36,24 @@ using System.Text;
 using System.Xml.XPath;
 
 
-namespace System.Xml.Xsl {
-	internal abstract class XslTransformImpl {
-
+namespace System.Xml.Xsl
+{
+	internal abstract class XslTransformImpl
+	{
 		public virtual void Load (string url, XmlResolver resolver)
 		{
-			Load (new XPathDocument (url, XmlSpace.Preserve).CreateNavigator (), resolver, null);
+			XmlResolver res = resolver;
+			if (res == null)
+				res = new XmlUrlResolver ();
+			Uri uri = res.ResolveUri (null, url);
+			using (Stream s = res.GetEntity (uri, null, typeof (Stream)) as Stream) {
+				XmlTextReader xtr = new XmlTextReader (uri.ToString (), s);
+				xtr.XmlResolver = res;
+				XmlValidatingReader xvr = new XmlValidatingReader (xtr);
+				xvr.XmlResolver = res;
+				xvr.ValidationType = ValidationType.None;
+				Load (new XPathDocument (xvr, XmlSpace.Preserve).CreateNavigator (), resolver, null);
+			}
 		}
 
 		public virtual void Load (XmlReader stylesheet, XmlResolver resolver, Evidence evidence)