[ https://issues.apache.org/jira/browse/XERCESJ-1515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16977130#comment-16977130 ]
Mukul Gandhi commented on XERCESJ-1515: --------------------------------------- With the current xerces codebase on SVN, I find following not to be working properly about this Jira issue, Given the schema which Sandy has mentioned in this bug report, the following XML document (mentioned as well by Sandy in this bug report) produces invalid validation result (which Sandy says, should be valid), <root> <keyref/> </root> The above current issue, is observed on XSD 1.1 branch (in both XSD 1.0 & 1.1 modes) but not on trunk. I'm personally not sure at this moment, how this new issue has got introduced on the latest SVN state. But I feel that, this should be addressed. > Incomplete keyrefs should not need keys > --------------------------------------- > > Key: XERCESJ-1515 > URL: https://issues.apache.org/jira/browse/XERCESJ-1515 > Project: Xerces2-J > Issue Type: Bug > Components: XML Schema 1.0 Structures, XML Schema 1.1 Structures > Affects Versions: 2.11.0 > Reporter: Sandy Gao > Assignee: Sandy Gao > Priority: Major > Fix For: 2.12.0 > > > For the following schema: > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="root"> > <xs:complexType><xs:sequence> > <xs:element name="key" type="xs:string" minOccurs="0"> > <xs:key name="key"> > <xs:selector xpath="."/> > <xs:field xpath="."/> > </xs:key> > </xs:element> > <xs:element name="keyref"> > <xs:complexType> > <xs:attribute name="att" > type="xs:string"/> > </xs:complexType> > </xs:element> > </xs:sequence></xs:complexType> > <xs:keyref name="keyref" refer="key"> > <xs:selector xpath="keyref"/> > <xs:field xpath="@att"/> > </xs:keyref> > </xs:element> > </xs:schema> > And XML: > <root> > <key>xyz</key> > <keyref att="xyz"/> > </root> > This should be valid, because the key and keyref matches. And > <root> > <keyref att="xyz"/> > </root> > Should be invalid, because there is no key for the keyref. But > <root> > <keyref/> > </root> > Should be valid, because there is no "att" attribute present, so the keyref > is incomplete and doesn't need a key. But Xerces produces the error: > [Error] ...:3:8: Identity Constraint error: identity constraint > "KeyRef@860d49" has a keyref which refers to a key or unique that is out of > scope. -- 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