Author: atsushi
Date: 2005-03-15 11:40:38 -0500 (Tue, 15 Mar 2005)
New Revision: 41840
Modified:
trunk/mcs/class/System.XML/System.Xml/ChangeLog
trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs
trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs
Log:
2005-03-15 Atsushi Enomoto <[EMAIL PROTECTED]>
* DTDValidatingReader.cs : When expanding entities and there is a
sequence of text nodes, its value was not returned.
* XmlTextReader.cs : better invalid char error report for EOF.
Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog 2005-03-15 16:40:24 UTC
(rev 41839)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog 2005-03-15 16:40:38 UTC
(rev 41840)
@@ -1,3 +1,9 @@
+2005-03-15 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * DTDValidatingReader.cs : When expanding entities and there is a
+ sequence of text nodes, its value was not returned.
+ * XmlTextReader.cs : better invalid char error report for EOF.
+
2005-03-09 Andrew Skiba <[EMAIL PROTECTED]>
* XmlTextReader.cs, XmlParserInput.cs, DTDReader.cs: fix UCM-4
Modified: trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs
2005-03-15 16:40:24 UTC (rev 41839)
+++ trunk/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs
2005-03-15 16:40:38 UTC (rev 41840)
@@ -112,7 +112,7 @@
bool isSignificantWhitespace;
bool isWhitespace;
bool isText;
- bool nextMaybeSignificantWhitespace;
+ bool dontResetTextType;
// This field is used to get properties and to raise events.
XmlValidatingReader validatingReader;
@@ -370,7 +370,7 @@
isWhitespace = false;
isSignificantWhitespace = false;
isText = false;
- nextMaybeSignificantWhitespace = false;
+ dontResetTextType = false;
bool b = ReadContent () || currentTextValue != null;
if (!b && this.missingIDReferences.Count > 0) {
@@ -431,7 +431,6 @@
return false;
}
- bool dontResetTextType = false;
DTDElementDeclaration elem = null;
switch (reader.NodeType) {
@@ -569,7 +568,7 @@
constructingTextValue = null;
return true;
}
- goto case XmlNodeType.Text;
+ break;
case XmlNodeType.SignificantWhitespace:
if (!isText)
isSignificantWhitespace = true;
@@ -599,19 +598,9 @@
}
break;
case XmlNodeType.Whitespace:
- if (nextMaybeSignificantWhitespace) {
- currentTextValue = reader.Value;
- nextMaybeSignificantWhitespace = false;
- goto case
XmlNodeType.SignificantWhitespace;
- }
if (!isText && !isSignificantWhitespace)
isWhitespace = true;
- if (entityReaderStack.Count > 0 &&
validatingReader.EntityHandling == EntityHandling.ExpandEntities) {
- constructingTextValue += reader.Value;
- return ReadContent ();
- }
- ValidateWhitespaceNode ();
- break;
+ goto case XmlNodeType.Text;
case XmlNodeType.EntityReference:
if (validatingReader.EntityHandling ==
EntityHandling.ExpandEntities) {
ResolveEntity ();
@@ -619,6 +608,9 @@
}
break;
}
+ if (isWhitespace)
+ ValidateWhitespaceNode ();
+ currentTextValue = constructingTextValue;
constructingTextValue = null;
MoveToElement ();
return true;
Modified: trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs 2005-03-15
16:40:24 UTC (rev 41839)
+++ trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs 2005-03-15
16:40:38 UTC (rev 41840)
@@ -2569,7 +2569,7 @@
"expected '{0}' ({1:X}) but
found '{2}' ({3:X})",
(char) expected,
expected,
- (char) ch,
+ ch < 0 ? (object) "EOF" :
(char) ch,
ch));
}
}
@@ -2588,7 +2588,7 @@
if (i < 0x21 && XmlChar.IsWhitespace (i))
continue;
if (c != i)
- throw NotWFError (String.Format
(CultureInfo.InvariantCulture, "Expected {0}, but found {1} [{2}]", c, (char)
i, i));
+ throw NotWFError (String.Format
(CultureInfo.InvariantCulture, "Expected {0}, but found {1} [{2}]", c, i < 0 ?
(object) "EOF" : (char) i, i));
break;
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches