2004-04-12 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Mon, 12 Apr 2004 14:55:27 +0000 (14:55 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Mon, 12 Apr 2004 14:55:27 +0000 (14:55 -0000)
* 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

mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
mcs/class/System.XML/Mono.Xml.Xsl/Compiler.cs
mcs/class/System.XML/Mono.Xml.Xsl/HtmlEmitter.cs
mcs/class/System.XML/Mono.Xml.Xsl/MSXslScriptManager.cs
mcs/class/System.XML/Mono.Xml.Xsl/XslFunctions.cs

index 43133cd02116f2cb69b92df7064f448d9a529f93..ce1a29e810fb40b57a6e18c2caa8445eab5c409a 100644 (file)
@@ -1,3 +1,13 @@
+2004-04-12  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * 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  <atsushi@ximian.com>
 
        * ScriptCompilerInfo.cs : #line directive now holds dummy filename
index a884765872c63505d459b37cbf78560a554df8d2..ea13f3ecbdda9aab4633b8117141d67b8fc0ee12 100644 (file)
@@ -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)))
                        {
 
index 761ce08d82df0672757f1b92af302daa06381dd2..bf745c13e88acb26c2e2124f737d15f299f4ccc1 100644 (file)
@@ -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 ("  ");
index a488b4a8faa81510522bd3285b8faeaf98eba0d2..75495e0268673b1764a83d13b3c4085276628e9f 100644 (file)
@@ -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 {
index 6ca7c2f841ef6e19ab2511b5b43bb1b573b4a37c..8c7c6f7f7f516d84e795a2dbf66d2b767365da36 100755 (executable)
@@ -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);