Browse Source

2005-09-25 Atsushi Enomoto <[email protected]>

	* XmlSchemaValidationFlags.cs, XmlSchemaValidator.cs :
	  NET_2_0 API updates.

	* XmlReader.cs, XmlReaderSettings.cs, XmlDocument.cs:
	  XmlSchemaValidationFlags updates.

	* XmlSchemaValidatingReader.cs: XmlSchemaValidationFlags updates.

	* XmlReaderSettingsTests.cs : XmlSchemaValidationFlags NET_2_0 update.


svn path=/trunk/mcs/; revision=50732
Atsushi Eno 20 years ago
parent
commit
ccef6c8982

+ 4 - 0
mcs/class/System.XML/Mono.Xml.Schema/ChangeLog

@@ -1,3 +1,7 @@
+2005-09-25  Atsushi Enomoto <[email protected]>
+
+	* XmlSchemaValidatingReader.cs: XmlSchemaValidationFlags updates.
+
 2005-08-03  Gert Driesen <[email protected]>
 
 	* XsdValidationReader.cs: GetNamespacesInScope returns generic

+ 4 - 5
mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs

@@ -114,9 +114,9 @@ namespace Mono.Xml.Schema
 			nsResolver = reader as IXmlNamespaceResolver;
 			if (nsResolver == null)
 				throw new ArgumentException ("Argument XmlReader must implement IXmlNamespaceResolver.");
-			options = ValidationFlags.IgnoreValidationWarnings
-				| ValidationFlags.IgnoreSchemaLocation
-				| ValidationFlags.IgnoreInlineSchema;
+			options = ValidationFlags.ProcessValidationWarnings
+				| ValidationFlags.ProcessSchemaLocation
+				| ValidationFlags.ProcessInlineSchema;
 
 			this.reader = reader;
 			if (schemas == null)
@@ -198,8 +198,7 @@ namespace Mono.Xml.Schema
 				navigator.NameTable,
 				schemas,
 				navigator,
-				ValidationFlags.IgnoreSchemaLocation |
-					ValidationFlags.IgnoreInlineSchema);
+				ValidationFlags.ProcessIdentityConstraints);
 
 			readerLineInfo = navigator as IXmlLineInfo;
 			getter = delegate () { return Value; };

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

@@ -1,3 +1,8 @@
+2005-09-25  Atsushi Enomoto <[email protected]>
+
+	* XmlSchemaValidationFlags.cs, XmlSchemaValidator.cs :
+	  NET_2_0 API updates.
+
 2005-08-31  Sebastien Pouliot  <[email protected]>
 
 	* XmlSchemaException.cs: Added a Demand for SerializationFormatter

+ 9 - 4
mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidationFlags.cs

@@ -33,10 +33,15 @@ namespace System.Xml.Schema
 	[Flags]
 	public enum XmlSchemaValidationFlags
 	{
-		IgnoreInlineSchema = 1,
-		IgnoreSchemaLocation = 2,
-		IgnoreValidationWarnings = 4,
-		IgnoreIdentityConstraints = 8
+		None = 0,
+		ProcessInlineSchema = 1,
+		ProcessSchemaLocation = 2,
+		ProcessValidationWarnings = 4,
+		ProcessIdentityConstraints = 8,
+		// LAMESPEC: It is really idiotic idea to include such
+		// validation option that breaks W3C XML Schema specification
+		// compliance and interoperability.
+		AllowXmlAttributes = 16,
 	}
 }
 #endif

+ 2 - 2
mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs

@@ -202,12 +202,12 @@ namespace System.Xml.Schema
 
 		private bool IgnoreWarnings {
 			get { return (options & ValidationFlags
-				.IgnoreValidationWarnings) != 0; }
+				.ProcessValidationWarnings) == 0; }
 		}
 
 		private bool IgnoreIdentity {
 			get { return (options & ValidationFlags
-				.IgnoreIdentityConstraints) != 0; }
+				.ProcessIdentityConstraints) == 0; }
 		}
 
 		#endregion

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

@@ -1,3 +1,8 @@
+2005-09-25  Atsushi Enomoto <[email protected]>
+
+	* XmlReader.cs, XmlReaderSettings.cs, XmlDocument.cs:
+	  XmlSchemaValidationFlags updates.
+
 2005-09-21  Atsushi Enomoto <[email protected]>
 
 	* XmlWriterSettings.cs : true NET_2_0 updates.

+ 2 - 3
mcs/class/System.XML/System.Xml/XmlDocument.cs

@@ -990,15 +990,14 @@ namespace System.Xml
 		public void Validate (ValidationEventHandler handler)
 		{
 			Validate (handler, this,
-				XmlSchemaValidationFlags.IgnoreValidationWarnings);
+				XmlSchemaValidationFlags.ProcessIdentityConstraints);
 		}
 
 		public void Validate (ValidationEventHandler handler,
 			XmlNode node)
 		{
 			Validate (handler, node,
-				XmlSchemaValidationFlags.IgnoreValidationWarnings |
-				XmlSchemaValidationFlags.IgnoreIdentityConstraints);
+				XmlSchemaValidationFlags.ProcessIdentityConstraints);
 		}
 
 		private void Validate (ValidationEventHandler handler,

+ 5 - 4
mcs/class/System.XML/System.Xml/XmlReader.cs

@@ -403,13 +403,14 @@ namespace System.Xml
 			if (xvr != null)
 				xvr.SetSchemas (settings.Schemas);
 
-			if ((settings.ValidationFlags & XmlSchemaValidationFlags.IgnoreIdentityConstraints) != 0)
+			// Actually I don't think they are treated in DTD validation though...
+			if ((settings.ValidationFlags & XmlSchemaValidationFlags.ProcessIdentityConstraints) == 0)
 				throw new NotImplementedException ();
-			if ((settings.ValidationFlags & XmlSchemaValidationFlags.IgnoreInlineSchema) != 0)
+			if ((settings.ValidationFlags & XmlSchemaValidationFlags.ProcessInlineSchema) != 0)
 				throw new NotImplementedException ();
-			if ((settings.ValidationFlags & XmlSchemaValidationFlags.IgnoreSchemaLocation) != 0)
+			if ((settings.ValidationFlags & XmlSchemaValidationFlags.ProcessSchemaLocation) != 0)
 				throw new NotImplementedException ();
-			if ((settings.ValidationFlags & XmlSchemaValidationFlags.IgnoreValidationWarnings) == 0)
+			if ((settings.ValidationFlags & XmlSchemaValidationFlags.ProcessValidationWarnings) == 0)
 				throw new NotImplementedException ();
 
 			return xvr != null ? xvr : reader;

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

@@ -100,9 +100,7 @@ namespace System.Xml
 			prohibitDtd = false; // ? not documented
 			schemas = new XmlSchemaSet ();
 			validationFlags =
-				XsValidationFlags.IgnoreValidationWarnings
-				| XsValidationFlags.IgnoreSchemaLocation
-				| XsValidationFlags.IgnoreInlineSchema;
+				XsValidationFlags.ProcessIdentityConstraints;
 			validationType = ValidationType.None;
 			xmlResolver = new XmlUrlResolver ();
 		}

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

@@ -1,3 +1,7 @@
+2005-09-25  Atsushi Enomoto <[email protected]>
+
+	* XmlReaderSettingsTests.cs : XmlSchemaValidationFlags NET_2_0 update.
+
 2005-09-21  Atsushi Enomoto <[email protected]>
 
 	* XmlWriterSettingsTests.cs : removed NormalizeNewLines.

+ 8 - 6
mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs

@@ -36,15 +36,17 @@ namespace MonoTests.System.Xml
 				s.ConformanceLevel);
 			Assert (s.ValidationType != ValidationType.DTD);
 			AssertEquals (false, s.IgnoreComments);
-			Assert (0 != (s.ValidationFlags &
-				ValidationFlags.IgnoreInlineSchema));
+			Assert (0 == (s.ValidationFlags &
+				ValidationFlags.ProcessInlineSchema));
 			AssertEquals (false, s.IgnoreProcessingInstructions);
+			Assert (0 == (s.ValidationFlags &
+				ValidationFlags.ProcessSchemaLocation));
+			Assert (0 == (s.ValidationFlags &
+				ValidationFlags.ProcessValidationWarnings));
 			Assert (0 != (s.ValidationFlags &
-				ValidationFlags.IgnoreSchemaLocation));
-			Assert (0 != (s.ValidationFlags &
-				ValidationFlags.IgnoreValidationWarnings));
+				ValidationFlags.ProcessIdentityConstraints));
 			Assert (0 == (s.ValidationFlags &
-				ValidationFlags.IgnoreIdentityConstraints));
+				ValidationFlags.AllowXmlAttributes));
 			AssertEquals (false, s.IgnoreWhitespace);
 			AssertEquals (0, s.LineNumberOffset);
 			AssertEquals (0, s.LinePositionOffset);