[Mono-bugs] [Bug 49871][Cri] Changed - xml validating reader bug for parsing TOKEN type

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 21 Oct 2003 12:27:13 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ginga@kit.hi-ho.ne.jp.

http://bugzilla.ximian.com/show_bug.cgi?id=49871

--- shadow/49871	2003-10-20 14:37:22.000000000 -0400
+++ shadow/49871.tmp.6537	2003-10-21 12:27:13.000000000 -0400
@@ -92,6 +92,41 @@
 huge file....its very common u can even try on any simple xml file 
 and change itS type to XSD:TOKEN u'll get error.-:( -:(..any idea wt 
 should i do....
 
 Thanks
 Faisal.
+
+------- Additional Comments From ginga@kit.hi-ho.ne.jp  2003-10-21 12:27 -------
+I just realized that xs:normalizedString allows whitespaces wrapping 
+around the value, so you, XML Spy and Java validators might be right 
+in a sense. But MS.NET does not allow such token that has wrapping 
+whitespaces and/or two or more whitespace characters inside the value.
+
+Why do you need to use XmlValidatingReader? If you don't want to get 
+any validationg error, then you can set ValidationType = 
+ValidationType.None to your XmlValidatingReader.
+
+Anyway, I confirmed that current Mono XmlValidatingReader does not 
+validate any of such string values, but it might be a "bug" as you 
+summarized ;-), so I decided not to close it.
+
+BTW, I tried this:
+
+string schemaxml = "<xs:schema "
+	+ "xmlns:xs='http://www.w3.org/2001/XMLSchema'>"
+	+ "<xs:element name='root' /><xs:attribute name='foo' 
+type='xs:token' /></xs:schema>";
+XmlTextReader xstr = new XmlTextReader (schemaxml,
+	XmlNodeType.Document, null);
+XmlSchema schema = XmlSchema.Read (xstr, null);
+// I also tried a combination of element and simpleType.
+string instxml = "<root foo=' the token  string.'></root>"
+XmlTextReader xtr =
+	new XmlTextReader (instxml, XmlNodeType.Document, null);
+xtr.Normalization = true; // In fact it is meaningless.
+XmlValidatingReader xvr = new XmlValidatingReader (xtr);
+xvr.Schemas.Add (schema);
+xvr.Read ();
+xvr.Read ();	// token
+xvr.Read (); // MS.NET(1.1) raises an error here.
+