Hello.

I started to analyze the list of regressions that are found with W3C testsuite. They are listed in fixme.lst file in svn.

I found that undoing revision 41840 fixes 20 regressions from the list (although breaks one test).

I attach here the patch that you can apply to the latest System.XML to fix those 20 regressions. Please notice, it's not my patch, it's just a revert of a part of revision 41840. I made it so it's easy to verify these results.

Before the patch there are 0 regressions, and 10 fixes, after the attached patch there is 1 regressions and 30 fixes.

Please tell me what you think.

Cheers,
Andrew.
Index: System.Xml/DTDValidatingReader.cs
===================================================================
--- System.Xml/DTDValidatingReader.cs   (revision 45697)
+++ System.Xml/DTDValidatingReader.cs   (working copy)
@@ -114,7 +114,7 @@
                bool isSignificantWhitespace;
                bool isWhitespace;
                bool isText;
-               bool dontResetTextType;
+               bool nextMaybeSignificantWhitespace;
 
                // This field is used to get properties and to raise events.
                XmlValidatingReader validatingReader;
@@ -370,7 +370,7 @@
                        isWhitespace = false;
                        isSignificantWhitespace = false;
                        isText = false;
-                       dontResetTextType = false;
+                        nextMaybeSignificantWhitespace = false;
 
                        bool b = ReadContent () || currentTextValue != null;
                        if (!b && this.missingIDReferences.Count > 0) {
@@ -432,6 +432,7 @@
                                return false;
                        }
 
+                        bool dontResetTextType = false;
                        DTDElementDeclaration elem = null;
 
                        switch (reader.NodeType) {
@@ -574,7 +575,7 @@
                                        constructingTextValue = null;
                                        return true;
                                }
-                               break;
+                                goto case XmlNodeType.Text;
                        case XmlNodeType.SignificantWhitespace:
                                if (!isText)
                                        isSignificantWhitespace = true;
@@ -604,9 +605,19 @@
                                }
                                break;
                        case XmlNodeType.Whitespace:
+                                if (nextMaybeSignificantWhitespace) {
+                                        currentTextValue = reader.Value;
+                                        nextMaybeSignificantWhitespace = false;
+                                        goto case 
XmlNodeType.SignificantWhitespace;
+                                }
                                if (!isText && !isSignificantWhitespace)
                                        isWhitespace = true;
-                               goto case XmlNodeType.Text;
+                                if (entityReaderStack.Count > 0 && 
validatingReader.EntityHandling == EntityHandling.ExpandEntities) {
+                                        constructingTextValue += reader.Value;
+                                        return ReadContent ();
+                                }
+                                ValidateWhitespaceNode ();
+                                break;
                        case XmlNodeType.EntityReference:
                                if (validatingReader.EntityHandling == 
EntityHandling.ExpandEntities) {
                                        ResolveEntity ();
@@ -614,9 +625,6 @@
                                }
                                break;
                        }
-                       if (isWhitespace)
-                               ValidateWhitespaceNode ();
-                       currentTextValue = constructingTextValue;
                        constructingTextValue = null;
                        MoveToElement ();
                        return true;
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to