Topic: xsd:keyref Visibility of a key

Whether correctly I understand, that in XML  referential integrity, elements xsd:key and xsd:keyref should be declared in same an element xsd:element (selectors can specify anywhere). If it is true, as then to treat a phrase
[quote =] refer Required. Specifies the name of a key or unique element defined in this or another schema

as they can be declared in different circuits if they have to have one parent?
Yours faithfully, Vasilisk