You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Mukul Gandhi (Jira)" <xe...@xml.apache.org> on 2019/12/20 11:02:00 UTC
[jira] [Updated] (XERCESJ-1515) Incomplete keyrefs should not need
keys
[ https://issues.apache.org/jira/browse/XERCESJ-1515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mukul Gandhi updated XERCESJ-1515:
----------------------------------
Fix Version/s: (was: 2.12.0)
2.12.1
Replicating fix for this issue, from trunk to the xsd 1.1 development branch.
> 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.1
>
>
> 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-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org