* XslTransformTests.cs: Undo formatting change.
authorGert Driesen <drieseng@users.sourceforge.net>
Sun, 4 Dec 2005 19:17:02 +0000 (19:17 -0000)
committerGert Driesen <drieseng@users.sourceforge.net>
Sun, 4 Dec 2005 19:17:02 +0000 (19:17 -0000)
svn path=/trunk/mcs/; revision=53903

mcs/class/System.XML/Test/System.Xml.Xsl/ChangeLog
mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs

index 996f54c228c8295474a4557f504ab75da0fe3d26..fc2b212e93d173d2f04a30095be8f452831f2c21 100644 (file)
@@ -1,10 +1,14 @@
 2005-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
 
-       * XslTransformTest.cs: Added test for MS bug, described in KB834667.
+       * XslTransformTests.cs: Undo formatting changes.
 
 2005-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
 
-       * XslTransformTest.cs: Added test for sorting an empty node set, which
+       * XslTransformTests.cs: Added test for MS bug, described in KB834667.
+
+2005-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
+
+       * XslTransformTests.cs: Added test for sorting an empty node set, which
        is also a test for omitting XML declaration if no XML is output.
        No longer derive from deprecated Assertion class, formatting updates.
 
index 3013996abc491d5ba5bfcd4306b21abdceb9de7c..4d53c5c33408b2ea8cae7e517015f21ce63cc3c3 100644 (file)
@@ -67,21 +67,21 @@ namespace MonoTests.System.Xml.Xsl
                public void InvalidStylesheet2 ()
                {
                        string xsl = @"<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
-                               <xsl:template match='/root'>
-                                       <xsl:call-template name='foo'>
-                                               <xsl:with-param name='name' value='text()' />
-                                       </xsl:call-template>
-                               </xsl:template>
-                               <xsl:template name='foo'>
-                                       <xsl:param name='name' />
-                                       <result>
-                                               <xsl:if test='1'>
-                                                       <xsl:variable name='last' value='text()' />
-                                                       <xsl:value-of select='$last' />
-                                               </xsl:if>
-                                       </result>
-                               </xsl:template>
-                       </xsl:stylesheet>
+<xsl:template match='/root'>
+       <xsl:call-template name='foo'>
+               <xsl:with-param name='name' value='text()' />
+       </xsl:call-template>
+</xsl:template>
+<xsl:template name='foo'>
+       <xsl:param name='name' />
+       <result>
+               <xsl:if test='1'>
+                       <xsl:variable name='last' value='text()' />
+                       <xsl:value-of select='$last' />
+               </xsl:if>
+       </result>
+</xsl:template>
+</xsl:stylesheet>
 ";
                        XslTransform xslt = new XslTransform ();
                        xslt.Load (new XPathDocument (new XmlTextReader (xsl, XmlNodeType.Document, null)));
@@ -91,19 +91,20 @@ namespace MonoTests.System.Xml.Xsl
                [Category ("NotWorking")] // it depends on "mcs" existence
                public void MsxslTest() {
                        string _styleSheet = @"
-                       <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=""test"">
-                                       <xslt:value-of select=""stringutils:PadRight(@name, 20)"" />
-                               </xslt:template>
-                       </xslt:stylesheet>";
+                       <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=""test"">
+       <xslt:value-of select=""stringutils:PadRight(@name, 20)"" />
+</xslt:template>
+</xslt:stylesheet>";
 
                        StringReader stringReader = new StringReader(_styleSheet);
                        
@@ -127,18 +128,19 @@ namespace MonoTests.System.Xml.Xsl
                [Test]
                public void MSXslNodeSet ()
                {
-                       string xsl = @"<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
-                               <xsl:template match='/'>
-                                       <root>
-                                               <xsl:variable name='var'>
-                                                       <xsl:copy-of select='root/foo' />
-                                               </xsl:variable>
-                                               <xsl:for-each select='msxsl:node-set($var)/foo'>
-                                                       <xsl:value-of select='name(.)' />: <xsl:value-of select='@attr' />
-                                               </xsl:for-each>
-                                       </root>
-                               </xsl:template>
-                       </xsl:stylesheet>";
+                       string xsl = @"<xsl:stylesheet version='1.0' 
+xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
+<xsl:template match='/'>
+       <root>
+               <xsl:variable name='var'>
+                       <xsl:copy-of select='root/foo' />
+               </xsl:variable>
+               <xsl:for-each select='msxsl:node-set($var)/foo'>
+                       <xsl:value-of select='name(.)' />: <xsl:value-of select='@attr' />
+               </xsl:for-each>
+       </root>
+</xsl:template>
+</xsl:stylesheet>";
                        StringWriter sw = new StringWriter ();
                        XslTransform t = new XslTransform ();
                        t.Load (new XPathDocument (new StringReader (xsl)));
@@ -155,16 +157,17 @@ namespace MonoTests.System.Xml.Xsl
                [ExpectedException (typeof (XPathException))]
                public void MSXslNodeSetRejectsNodeSet ()
                {
-                       string xsl = @"<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
-                               <xsl:template match='/'>
-                                       <root>
-                                               <!-- msxsl:node-set() does not accept a node set -->
-                                               <xsl:for-each select='msxsl:node-set(root/foo)'>
-                                                       <xsl:value-of select='name(.)' />: <xsl:value-of select='@attr' />
-                                               </xsl:for-each>
-                                       </root>
-                               </xsl:template>
-                       </xsl:stylesheet>";
+                       string xsl = @"<xsl:stylesheet version='1.0' 
+xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
+<xsl:template match='/'>
+       <root>
+               <!-- msxsl:node-set() does not accept a node set -->
+               <xsl:for-each select='msxsl:node-set(root/foo)'>
+                       <xsl:value-of select='name(.)' />: <xsl:value-of select='@attr' />
+               </xsl:for-each>
+       </root>
+</xsl:template>
+</xsl:stylesheet>";
                        StringWriter sw = new StringWriter ();
                        XslTransform t = new XslTransform ();
                        t.Load (new XPathDocument (new StringReader (xsl)));
@@ -175,11 +178,11 @@ namespace MonoTests.System.Xml.Xsl
                public void EvaluateEmptyVariableAsBoolean ()
                {
                        string xsl = @"<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
-                               <xsl:template match='/'>
-                                       <xsl:variable name='var'><empty /></xsl:variable>
-                                       <root><xsl:if test='$var'>true</xsl:if></root>
-                               </xsl:template>
-                       </xsl:stylesheet>";
+<xsl:template match='/'>
+       <xsl:variable name='var'><empty /></xsl:variable>
+       <root><xsl:if test='$var'>true</xsl:if></root>
+</xsl:template>
+</xsl:stylesheet>";
                        XslTransform t = new XslTransform ();
                        t.Load (new XPathDocument (new StringReader (xsl)));
                        StringWriter sw = new StringWriter ();
@@ -195,10 +198,10 @@ namespace MonoTests.System.Xml.Xsl
                public void NotAllowedPatternAxis ()
                {
                        string xsl = @"<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
-                               <xsl:template match='/descendant-or-self::node()/elem'>
-                                       <ERROR/>
-                               </xsl:template>
-                       </xsl:stylesheet>";
+<xsl:template match='/descendant-or-self::node()/elem'>
+       <ERROR/>
+</xsl:template>
+</xsl:stylesheet>";
                        new XslTransform ().Load (new XPathDocument (
                                new StringReader (xsl)));
                }
@@ -208,9 +211,9 @@ namespace MonoTests.System.Xml.Xsl
                public void ImportIncorrectlyLocated ()
                {
                        string xsl = @"<xsl:transform xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
-                               <xsl:template match='/'></xsl:template>
-                               <xsl:import href='dummy.xsl' />
-                       </xsl:transform>";
+<xsl:template match='/'></xsl:template>
+       <xsl:import href='dummy.xsl' />
+</xsl:transform>";
                        new XslTransform ().Load (new XPathDocument (
                                new StringReader (xsl)));
                }
@@ -405,10 +408,6 @@ namespace MonoTests.System.Xml.Xsl
 
                // http://support.microsoft.com/default.aspx?scid=kb;en-us;834667
                [Test]
-#if ONLY_1_1
-               // bug is not yet fixed in .NET 1.1 SP1
-               [Category ("NotDotNet")]
-#endif
                public void LocalParameter ()
                {
                        string xsltFragment = @"<?xml version=""1.0"" encoding=""UTF-8"" ?>