DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25271>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25271

Adding element in complexType derivation by restriction

           Summary: Adding element in complexType derivation by restriction
           Product: Xerces2-J
           Version: 2.6.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: XML Schema Structures
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Xerces allows to add element in derivation by restriction. I think this is 
against specification:
2.2.1.1 Type Definition Hierarchy
3.4.6 Schema Component Constraint: Derivation Valid (Restriction, Complex)
3.9.6 Particle Valid (Restriction)

Here is example which is valid for Xerces (and I think it should not be):

XML Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
        <xs:element name="root" type="base"/>
        <xs:complexType name="base">
                <xs:sequence>
                        <xs:element name="first" type="xs:string"/>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="derived">
                <xs:complexContent>
                        <xs:restriction base="base">
                                <xs:all>
                                        <xs:element name="first"/>
                                        <xs:element name="next"/>
                                </xs:all>
                        </xs:restriction>
                </xs:complexContent>
        </xs:complexType>
</xs:schema>


XML Schema instance:
<?xml version="1.0" encoding="UTF-8"?>
<root xsi:type="derived" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
        <next></next>
        <first>text</first>
</root>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to