ソースを参照

2007-08-08 Atsushi Enomoto <[email protected]>

	* XslCallTemplate.cs : significant whitespace should be allowed
	  as its content. Fixed bug #82357.

	* XslTransformTests.cs : added test for bug #82357.


svn path=/trunk/mcs/; revision=83634
Atsushi Eno 18 年 前
コミット
30e916409c

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

@@ -1,3 +1,8 @@
+2007-08-08  Atsushi Enomoto  <[email protected]>
+
+	* XslCallTemplate.cs : significant whitespace should be allowed
+	  as its content. Fixed bug #82357.
+
 2007-06-28  Atsushi Enomoto  <[email protected]>
 
 	* XslText.cs XslMessage.cs XslVariable.cs XslNotSupportedOperation.cs

+ 1 - 0
mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCallTemplate.cs

@@ -55,6 +55,7 @@ namespace Mono.Xml.Xsl.Operations {
 					switch (c.Input.NodeType) {
 					case XPathNodeType.Comment:
 					case XPathNodeType.ProcessingInstruction:
+					case XPathNodeType.SignificantWhitespace:
 					case XPathNodeType.Whitespace:
 						continue;
 					case XPathNodeType.Element:

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

@@ -1,3 +1,7 @@
+2007-08-08  Atsushi Enomoto  <[email protected]>
+
+	* XslTransformTests.cs : added test for bug #82357.
+
 2006-04-07  Atsushi Enomoto  <[email protected]>
 
 	* XslTransformTests.cs : added CurrentInSelect().

+ 19 - 0
mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs

@@ -1914,5 +1914,24 @@ Services
 				Assert.AreEqual (s, sw.ToString ());
 			}
 		}
+
+		[Test]
+		public void CallTemplateSignificantWhitespace ()
+		{
+			// bug #82357
+			string xsl = @"<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
+  <xsl:template name='foo' xml:space='preserve'>
+    <xsl:call-template name='bar'>
+      <xsl:with-param name='hoge' select='hoge' />
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name='bar'>
+  </xsl:template>
+</xsl:stylesheet>";
+			XslTransform t = new XslTransform ();
+			t.Load (new XmlTextReader (new StringReader (xsl)));
+			t.Transform (new XPathDocument (new StringReader ("<dummy/>")), null, new XmlTextWriter (TextWriter.Null));
+		}
 	}
 }