[ https://issues.apache.org/jira/browse/XERCESJ-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16977139#comment-16977139 ]
Mukul Gandhi commented on XERCESJ-1585: --------------------------------------- I'm analyzing this bug report again (and request anyone else for the same), and would find it helpful to have a different XSD schema and XML input example, that illustrate this same bug. It's looking hard to understand the vocabulary of currently provided example in this bug report. My initial thoughts are that, the earlier fixes provided for this Jira issue has affected correctness (though, a minor one) in a different area of xerces's XSD IDC constraints implementation. > 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