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

Mukul Gandhi reopened XERCESJ-1585:
-----------------------------------

I'm reopening this issue, as there's an issue with how it was addressed 
originally.

> Change in behavior when a keyref refers an out-of-scope unique or key
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1585
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1585
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>            Assignee: Mukul Gandhi
>            Priority: Major
>             Fix For: 2.12.0
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> If I have the following XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <Top xmlns="www.bla.com"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="www.bla.com test.xsd">
>     <Sub_1>
>         <Sub_2/>
>         <Sub_2/>
>     </Sub_1>
>     <Sub_1a>
>         <Sub_2a/>
>     </Sub_1a>
> </Top>
> and validate it with the following XML Schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
> elementFormDefault="qualified"
>     targetNamespace="www.bla.com" xmlns:ns="www.bla.com">
>     
>     <xs:element name="Top">
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element name="Sub_1">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element maxOccurs="unbounded" name="Sub_2">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubID" 
> use="optional"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:key name="newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="@SubID"/>
>                     </xs:key>
>                 </xs:element>
>                 <xs:element name="Sub_1a">
>                     <xs:complexType>
>                         <xs:sequence>
>                             <xs:element name="Sub_2a">
>                                 <xs:complexType>
>                                     <xs:attribute name="SubIDPtr"/>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:sequence>
>                     </xs:complexType>
>                     <xs:keyref name="newKeyref" refer="ns:newKey">
>                         <xs:selector xpath="Sub_2a"/>
>                         <xs:field xpath="SubIDPtr"/>
>                     </xs:keyref>
>                 </xs:element>
>             </xs:sequence>
>         </xs:complexType>
>     </xs:element>
> </xs:schema>
> In Xerces 2.9.0 the following error was reported:
> Identity Constraint error:  identity constraint "KeyRef@79ff89" has a keyref 
> which refers to a key or unique that is out of scope. 
> @Line 11 Column 14
> In Xerces 2.11.0 (using the 'xerces-java-xml-schema-1.1-dev' branch) the 
> sample is considered valid when validated either with XML Schema 1.0 or 1.1 
> support.
> Was there any functionality lost?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to