Anytype prevent identity constraint application
-----------------------------------------------

                 Key: XERCESC-1884
                 URL: https://issues.apache.org/jira/browse/XERCESC-1884
             Project: Xerces-C++
          Issue Type: Bug
          Components: Validating Parser (XML Schema)
    Affects Versions: 2.7.0
         Environment: Linux 2.6.5-7.244-smp x86_64 GNU/Linux
            Reporter: Thomas Carcaud
            Priority: Minor
         Attachments: anytype_prevent_id_constraint.xml, 
anytype_prevent_id_constraint.xsd

ID declaration is not found when it is enclosed in two levels of anytype 
elements. 
In this example :
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">
    <xs:element name="bigBadWolf">
        <xs:complexType>
            <xs:sequence maxOccurs="unbounded">
                <xs:element name="eat">
                    <xs:complexType>
                        <xs:attribute name="ref" type="xs:IDREF"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="littlePig">
        <xs:complexType>
            <xs:attribute name="id" type="xs:ID"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="world">
        <xs:complexType>
            <xs:all>
                <xs:element name="strawHouse"/>
                <xs:element name="stickHouse"/>
                <xs:element name="brickHouse"/>
                <xs:element ref="bigBadWolf"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

<?xml version="1.0" encoding="UTF-8"?>
<world xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="anytype_prevent_id_constraint.xsd">
    <strawHouse>
        <littlePig id="first"/>
    </strawHouse>
    <stickHouse>
        <littlePig id="second"/>
    </stickHouse>
    <brickHouse>
        <thickWall>
            <littlePig id="third"/>
        </thickWall>
    </brickHouse>
    <bigBadWolf>
        <eat ref="first"/>
        <eat ref="second"/>
        <eat ref="third"/>
    </bigBadWolf>
</world>

Validation fails with error "ID attribute 'third' was referenced but never 
declared".  Same kind of problem can be reproduced with unique/key and keyref 
and it also prevent duplicate id detection.
>From my investigations in IGXMLScanner , at the brickHouse level, modelType == 
>SchemaElementDecl::Any will set laxThisOne to true. Then at the thickWall 
>level, laxThisOne set fValidate to false. And this disable the call to 
>fICHandler->activateIdentityConstraint.
My text editor using XercesJ 2.9.1 does not suffer from this bug.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to