After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 347316 - Incorrect validation of W3C XML schema
Incorrect validation of W3C XML schema
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.x
Other All
: Normal normal
: ---
Assigned To: kbuchcik
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-12 15:01 UTC by David Belius
Modified: 2006-07-12 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Belius 2006-07-12 15:01:53 UTC
Please describe the problem:
The xml document below is not validating correctly, I get the follow error:
complex type 'pwdcontrol_type': The content type must specify a particle.

With xerces-j the document is validated correctly.

-----------XML document---------------

<?xml version="1.0" encoding="UTF-8"?>
<policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="inheritance_test1.xsd">

    <pwdcontrol min_chars="dgsd">
        
    </pwdcontrol>
</policy>

------------- XML SCHEMA ------------------

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="policy">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="control" maxOccurs="unbounded">
                    
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="control" abstract="true" type="control_type">
    </xs:element>
        
    <xs:element name="loggingcontrol" type="loggingcontrol_type" substitutionGroup="control">
        
    </xs:element>
    <xs:complexType name="control_type" abstract="true">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    
    
    <xs:complexType name="pwdcontrol_type">
        <xs:complexContent>
            <xs:extension base="control_type">
                <xs:attribute name="min_chars" use="required"/>                  
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    
    <xs:complexType name="loggingcontrol_type">
        <xs:complexContent>
            <xs:extension base="control_type">
                <xs:attribute use="required" name="logfile">
                    
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:element name="pwdcontrol" substitutionGroup="control" type="pwdcontrol_type">
        
    </xs:element>
</xs:schema>





Steps to reproduce:
1. Put xml document above into a file
2. Put the schema in a file in the same directory named inheritance_test1.xsd
3. Validate using libxml2


Actual results:
I get the error:
complex type 'pwdcontrol_type': The content type must specify a particle.

Expected results:
Correct validation.

Does this happen every time?
Yes.

Other information:
Comment 1 kbuchcik 2006-07-12 15:55:47 UTC
Fixed now in the CVS HEAD, xmlschemas.c, revision 1.204.

In xmlSchemaFixupComplexType(), the simple type, which was
the content type definition of a complex type, which in turn
was the base type of a extending complex type, was missed to
be set on this extending complex type in the derivation machinery.

Thanks for the report!