Author: atsushi
Date: 2005-05-07 12:11:07 -0400 (Sat, 07 May 2005)
New Revision: 44200
Modified:
trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
trunk/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs
trunk/mcs/class/System.XML/Test/System.Xml.Xsl/ChangeLog
trunk/mcs/class/System.XML/Test/System.Xml.Xsl/MsxslScriptTests.cs
Log:
2005-05-07 Atsushi Enomoto <[EMAIL PROTECTED]>
* MSXslScriptManager.cs : it should ignore compiler warnings. This
fixes bug #74859.
* MSXslScriptTests.cs : added testcase for bug #74859.
Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog 2005-05-07 15:24:06 UTC
(rev 44199)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog 2005-05-07 16:11:07 UTC
(rev 44200)
@@ -1,3 +1,8 @@
+2005-05-07 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * MSXslScriptManager.cs : it should ignore compiler warnings. This
+ fixes bug #74859.
+
2005-04-07 Andrew Skiba <[EMAIL PROTECTED]>
* XslDecimalFormat.jvm.cs : added
Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs
2005-05-07 15:24:06 UTC (rev 44199)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs
2005-05-07 16:11:07 UTC (rev 44200)
@@ -103,11 +103,14 @@
string source = SourceTemplate.Replace ("{0}",
DateTime.Now.ToString ()).Replace ("{1}", classSuffix).Replace ("{2}",
lineInfoLine + code);
CompilerResults res =
compiler.CompileAssemblyFromSource (parameters, source);
- if (res.Errors.Count != 0)
-// throw new XsltCompileException ("Stylesheet
script compile error: \n" + FormatErrorMessage (res) /*+ "Code :\n" + source*/,
null, scriptNode);
- // Actually it should be XsltCompileException,
- // but to match with silly MS implementation...
- throw new XsltException ("Stylesheet script
compile error: \n" + FormatErrorMessage (res) /*+ "Code :\n" + source*/, null,
scriptNode);
+ foreach (CompilerError err in res.Errors)
+ if (!err.IsWarning)
+ // Actually it should be
+ // XsltCompileException, but to match
+ // with silly MS implementation...
+// throw new XsltCompileException
("Stylesheet script compile error: \n" + FormatErrorMessage (res) /*+ "Code
:\n" + source*/, null, scriptNode);
+ throw new XsltException ("Stylesheet
script compile error: \n" + FormatErrorMessage (res) /*+ "Code :\n" + source*/,
null, scriptNode);
+
if (res.CompiledAssembly == null)
throw new XsltCompileException ("Cannot compile
stylesheet script", null, scriptNode);
return res.CompiledAssembly.GetType
("GeneratedAssembly.Script" + classSuffix);
Modified: trunk/mcs/class/System.XML/Test/System.Xml.Xsl/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml.Xsl/ChangeLog 2005-05-07
15:24:06 UTC (rev 44199)
+++ trunk/mcs/class/System.XML/Test/System.Xml.Xsl/ChangeLog 2005-05-07
16:11:07 UTC (rev 44200)
@@ -1,3 +1,7 @@
+2005-05-07 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * MSXslScriptTests.cs : added testcase for bug #74859.
+
2005-03-24 Atsushi Enomoto <[EMAIL PROTECTED]>
* XslTransformTests.cs : added (extra) test which verifies that
Modified: trunk/mcs/class/System.XML/Test/System.Xml.Xsl/MsxslScriptTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml.Xsl/MsxslScriptTests.cs
2005-05-07 15:24:06 UTC (rev 44199)
+++ trunk/mcs/class/System.XML/Test/System.Xml.Xsl/MsxslScriptTests.cs
2005-05-07 16:11:07 UTC (rev 44200)
@@ -160,5 +160,33 @@
</xsl:stylesheet>";
xslt.Load (new XmlTextReader (script,
XmlNodeType.Document, null));
}
+
+ [Test]
+ [Category ("NotWorking")] // it depends on "mcs" existence
+ public void CompilerWarningsShouldBeIgnored ()
+ {
+ string script = @"<xslt:stylesheet
xmlns:xslt='http://www.w3.org/1999/XSL/Transform' version='1.0'
xmlns:msxsl='urn:schemas-microsoft-com:xslt'
+ xmlns:stringutils='urn:schemas-sourceforge.net-blah'>
+ <xslt:output method='text' />
+ <msxsl:script language='C#' implements-prefix='stringutils'>
+ <![CDATA[
+ string PadRight( string str, int padding) {
+ return str.PadRight(padding);
+ }
+ ]]>
+ </msxsl:script>
+ <xslt:template match='project'>
+ <xslt:apply-templates select='target[string(@description) !=
'' ]'>
+ <xslt:sort select='@name' order='ascending' />
+ </xslt:apply-templates>
+ </xslt:template>
+ <xslt:template match='target'>
+ <xslt:value-of select='stringutils:PadRight(@name, 20)' />
+ <xslt:value-of select='@description' />
+ </xslt:template>
+</xslt:stylesheet>";
+ xslt.Load (new XmlTextReader (script,
XmlNodeType.Document, null));
+ xslt.Transform (doc.CreateNavigator (), null, new
XmlTextWriter (TextWriter.Null));
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches