ソースを参照

2004-04-12 Atsushi Enomoto <[email protected]>

	* Compiler.cs : When BaseURI is an empty string, it should not try to
	  create Uri instance. This will fix bug #56832, but not sure.
	* XslFunctions.cs : for XsltDocument.Resolve(), did the same.
	* HtmlEmitter.cs : Environment.NewLine was incorrectly used (it
	  should be the TextReader's NewLine).
	* MSXslScriptManager.cs : Should raise an error when the prefix which
	  was specified by "implements-prefix" was not found.

svn path=/trunk/mcs/; revision=25365
Atsushi Eno 22 年 前
コミット
85bcbb0dec

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

@@ -1,3 +1,13 @@
+2004-04-12  Atsushi Enomoto  <[email protected]>
+
+	* Compiler.cs : When BaseURI is an empty string, it should not try to
+	  create Uri instance. This will fix bug #56832, but not sure.
+	* XslFunctions.cs : for XsltDocument.Resolve(), did the same.
+	* HtmlEmitter.cs : Environment.NewLine was incorrectly used (it 
+	  should be the TextReader's NewLine).
+	* MSXslScriptManager.cs : Should raise an error when the prefix which
+	  was specified by "implements-prefix" was not found.
+
 2004-03-27  Atsushi Enomoto  <[email protected]>
 
 	* ScriptCompilerInfo.cs : #line directive now holds dummy filename

+ 2 - 1
mcs/class/System.XML/Mono.Xml.Xsl/Compiler.cs

@@ -172,7 +172,8 @@ namespace Mono.Xml.Xsl
 		public void PushInputDocument (string url)
 		{
 			// todo: detect recursion
-			Uri absUri = res.ResolveUri (new Uri (Input.BaseURI), url);
+			Uri baseUriObj = (Input.BaseURI == String.Empty) ? null : new Uri (Input.BaseURI);
+			Uri absUri = res.ResolveUri (baseUriObj, url);
 			using (Stream s = (Stream)res.GetEntity (absUri, null, typeof(Stream)))
 			{
 

+ 1 - 1
mcs/class/System.XML/Mono.Xml.Xsl/HtmlEmitter.cs

@@ -139,7 +139,7 @@ namespace Mono.Xml.Xsl
 			case "TD":
 			case "TH":
 			case "TR":
-				writer.Write (Environment.NewLine);
+				writer.Write (writer.NewLine);
 				int count = elementNameStack.Count;
 				for (int i = 0; i < count; i++)
 					writer.Write ("  ");

+ 4 - 1
mcs/class/System.XML/Mono.Xml.Xsl/MSXslScriptManager.cs

@@ -33,7 +33,10 @@ namespace Mono.Xml.Xsl {
 		{
 			MSXslScript s = new MSXslScript (c.Input, c.Evidence, scripts.Count);
 			this.evidence = c.Evidence;
-			scripts.Add (c.Input.GetNamespace (s.ImplementsPrefix), s.Compile ());
+			string ns = c.Input.GetNamespace (s.ImplementsPrefix);
+			if (ns == null)
+				throw new XsltCompileException ("Specified prefix for msxsl:script was not found: " + s.ImplementsPrefix, null, c.Input);
+			scripts.Add (ns, s.Compile ());
 		}
 		
 		enum ScriptingLanguage {

+ 1 - 1
mcs/class/System.XML/Mono.Xml.Xsl/XslFunctions.cs

@@ -217,7 +217,7 @@ namespace Mono.Xml.Xsl
 			XmlResolver r = p.Resolver;
 			
 			Uri uriBase = null;
-			if (! object.ReferenceEquals (baseUri, VoidBaseUriFlag))
+			if (! object.ReferenceEquals (baseUri, VoidBaseUriFlag) && baseUri != String.Empty)
 				uriBase = r.ResolveUri (null, baseUri);
 				
 			return r.ResolveUri (uriBase, thisUri);