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 "Sandy Gao (JIRA)" <xe...@xml.apache.org> on 2011/05/30 21:43:47 UTC
[jira] [Created] (XERCESJ-1515) Incomplete keyrefs should not need
keys
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
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 is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org
[jira] [Resolved] (XERCESJ-1515) Incomplete keyrefs should not need
keys
Posted by "Sandy Gao (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESJ-1515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sandy Gao resolved XERCESJ-1515.
--------------------------------
Resolution: Fixed
Fixed in both Schema 1.0 and 1.1.
> 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
>
> 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 is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org