|
|
@@ -5,8 +5,10 @@
|
|
|
// Atsushi Enomoto <[email protected]>
|
|
|
//
|
|
|
// (C)2003 Atsushi Enomoto
|
|
|
+// (C)2005-2006 Novell, Inc.
|
|
|
//
|
|
|
using System;
|
|
|
+using System.IO;
|
|
|
using System.Xml;
|
|
|
using System.Xml.Schema;
|
|
|
using NUnit.Framework;
|
|
|
@@ -289,5 +291,33 @@ namespace MonoTests.System.Xml
|
|
|
AssertEquals (" ", vr.ReadTypedValue ());
|
|
|
AssertEquals (XmlNodeType.EndElement, vr.NodeType);
|
|
|
}
|
|
|
+
|
|
|
+ [Test] // bug #77241
|
|
|
+ public void EmptyContentAllowWhitespace ()
|
|
|
+ {
|
|
|
+ string doc = @"
|
|
|
+<root>
|
|
|
+ <!-- some comment -->
|
|
|
+ <child/>
|
|
|
+</root>
|
|
|
+";
|
|
|
+ string schema = @"
|
|
|
+<xsd:schema xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
|
|
|
+ <xsd:element name=""root"">
|
|
|
+ <xsd:complexType>
|
|
|
+ <xsd:sequence>
|
|
|
+ <xsd:element name=""child"" type=""xsd:string"" />
|
|
|
+ </xsd:sequence>
|
|
|
+ </xsd:complexType>
|
|
|
+ </xsd:element>
|
|
|
+</xsd:schema>
|
|
|
+";
|
|
|
+ XmlValidatingReader reader = new XmlValidatingReader (
|
|
|
+ new XmlTextReader (new StringReader (doc)));
|
|
|
+ reader.Schemas.Add (null,
|
|
|
+ new XmlTextReader (new StringReader (schema)));
|
|
|
+ while (reader.Read ())
|
|
|
+ ;
|
|
|
+ }
|
|
|
}
|
|
|
}
|