Quellcode durchsuchen

2005-12-08 Atsushi Enomoto <[email protected]>

	* XmlReaderSettings.cs : ProhibitDtd is set as default.
	* XmlWriterSettings.cs : no set_OutputMethod.

	* XmlReaderCommonTests.cs : use ProhibitDtd=false in CreateSimple()
	  and added CreateSimpleProhibitDtd().


svn path=/trunk/mcs/; revision=54090
Atsushi Eno vor 20 Jahren
Ursprung
Commit
b78ca0c164

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

@@ -1,3 +1,8 @@
+2005-12-08  Atsushi Enomoto <[email protected]>
+
+	* XmlReaderSettings.cs : ProhibitDtd is set as default.
+	* XmlWriterSettings.cs : no set_OutputMethod.
+
 2005-11-30  Konstantin Triger  <[email protected]>
 
 	* IXmlNamespaceResolver.cs: TARGET_JVM namespace change.

+ 1 - 1
mcs/class/System.XML/System.Xml/XmlReaderSettings.cs

@@ -97,7 +97,7 @@ namespace System.Xml
 			ignoreWhitespace = false;
 			lineNumberOffset = 0;
 			linePositionOffset = 0;
-			prohibitDtd = false; // ? not documented
+			prohibitDtd = true;
 			schemas = new XmlSchemaSet ();
 			validationFlags =
 				XsValidationFlags.ProcessIdentityConstraints;

+ 1 - 1
mcs/class/System.XML/System.Xml/XmlWriterSettings.cs

@@ -154,7 +154,7 @@ namespace System.Xml
 		// does it affect only on XmlTextWriter?
 		public XmlOutputMethod OutputMethod {
 			get { return outputMethod; }
-			set { outputMethod = value; }
+			//set { outputMethod = value; }
 		}
 	}
 }

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

@@ -1,3 +1,8 @@
+2005-12-08  Atsushi Enomoto <[email protected]>
+
+	* XmlReaderCommonTests.cs : use ProhibitDtd=false in CreateSimple()
+	  and added CreateSimpleProhibitDtd().
+
 2005-11-09  Atsushi Enomoto <[email protected]>
 
 	* XmlWriterSettingsTests.cs : NormalizeNewLines does not exist anymore

+ 11 - 1
mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs

@@ -1447,7 +1447,9 @@ namespace MonoTests.System.Xml
 		[Test]
 		public void CreateSimple ()
 		{
-			XmlReader xr = XmlReader.Create ("Test/XmlFiles/nested-dtd-test.xml");
+			XmlReaderSettings s = new XmlReaderSettings ();
+			s.ProhibitDtd = false;
+			XmlReader xr = XmlReader.Create ("Test/XmlFiles/nested-dtd-test.xml", s);
 			xr.Read ();
 			AssertEquals ("#1", XmlNodeType.DocumentType, xr.NodeType);
 			xr.Read ();
@@ -1455,6 +1457,14 @@ namespace MonoTests.System.Xml
 			xr.Read ();
 			AssertEquals ("#3", XmlNodeType.Element, xr.NodeType);
 		}
+
+		[Test]
+		[ExpectedException (typeof (XmlException))]
+		public void CreateSimpleProhibitDtd ()
+		{
+			XmlReader xr = XmlReader.Create ("Test/XmlFiles/nested-dtd-test.xml");
+			xr.Read ();
+		}
 #endif
 	}
 }