[Mono-bugs] [Bug 339934] New: [2.0] XmlSchemaValidatingReader does not validate enumerations

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 7 13:52:55 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=339934#c322353

           Summary: [2.0] XmlSchemaValidatingReader does not validate
                    enumerations
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at ximian.com
          Found By: ---


A similar issue was reported (and fixed) in bug #322353.

To reproduce, compile and run the following code snippet (with the XSD from the
bug mentioned above):

using System;
using System.IO;
using System.Xml;
using System.Xml.Schema;

class MainTestCase
{
  static int Main ()
  {
    XmlSchema schema = XmlSchema.Read (new XmlTextReader ("schema.xsd"), null);

    XmlReaderSettings settings = new XmlReaderSettings ();
    settings.ValidationType = ValidationType.Schema;
    settings.Schemas.Add (schema);

    XmlReader reader = XmlReader.Create (new StringReader (xml), settings);
    try {
      while (reader.Read ()) ;
      return 1;
    } catch (XmlSchemaValidationException) {
    } finally {
      reader.Close ();
    }

    return 0;
  }

  static string xml = @"<test mode=""NOT A ENUMERATION VALUE""></test>";
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list