You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org> on 2009/11/18 09:16:39 UTC

[jira] Updated: (XERCESC-1884) Anytype prevent identity constraint application

     [ https://issues.apache.org/jira/browse/XERCESC-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov updated XERCESC-1884:
-------------------------------------

             Priority: Major  (was: Minor)
    Affects Version/s:     (was: 2.7.0)
                       3.1.0

The problem is still present in the 3.1.0 codebase.

> 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: 3.1.0
>         Environment: Linux 2.6.5-7.244-smp x86_64 GNU/Linux
>            Reporter: Thomas Carcaud
>         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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org