[Mono-bugs] [Bug 501814] New: Xml validation fails on complex content {content type} in some cases (patch included)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu May 7 11:16:27 EDT 2009


           Summary: Xml validation fails on complex content {content type}
                    in some cases (patch included)
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: i686
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: jonas.larsson at manodo.se
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10

The following validates flawlessly on .net, but not on mono. The problem is
different interpretations of 3.4.2 complex content {content type} in the specs.
Whatever one may think is "right" or "wrong" in this case, I think that
compatibility with .net is more important.

Test case:
string xsd = @"

  <xs:schema id='Layout'





  <xs:element name='Layout' type='Layout' />

  <xs:complexType name='Layout'>

   <xs:group ref='AnyLayoutElement' minOccurs='0' maxOccurs='unbounded' />


  <xs:group name='AnyLayoutElement'>


    <xs:element name='Label' type='Label' />   



  <xs:complexType name='LayoutElement' abstract='true'>

    <xs:attribute name='id' type='xs:ID' use='optional' />

    <xs:attribute name='visible' type='xs:boolean' use='optional'
default='true' />


  <xs:complexType name='Label'>

   <xs:complexContent mixed='true'>

    <xs:extension base='LayoutElement'>

    <xs:attribute name='bold' type='xs:boolean' use='required'/>





   XmlDocument doc = new XmlDocument ();

   XmlSchema schema = XmlSchema.Read (XmlReader.Create (new StringReader
(xsd)), null);   

   doc.LoadXml (@"

  <Layout xmlns='foo'>

    <Label bold='false'>Text inside label</Label>


   doc.Schemas.Add (schema);

   doc.Validate (null);

On mono this fails with:
System.Xml.Schema.XmlSchemaValidationException: XmlSchema error: Not allowed
character content was found.

I will submit a patch for this when this report is submitted and I have gotten
a bug number.

Reproducible: Always

Steps to Reproduce:
Run above code
Actual Results:  

Expected Results:  
Sucessful validation

Configure bugmail: http://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