Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - More Key/Keyref Questions [Thread Next] Re:To: "Xmlschema-dev" <xmlschema-dev@--.---> Date: 7/30/2004 4:34:00 AM
>
> Every time I think I've got the XML schema keys and keyrefs, they
> baffle me again.
>
I recognize the symptoms. My rule of thumb is:
if you have a rule that every E within the same Y must have a unique K,
(e.g. every "city" within the same "country" must have a unique "code") then
define the xs:key within the definition of Y, with a selector that selects E
from Y, and a field that selects K from E.
if you have a rule that every R within Y must have values of (I,J,K) that
match the values of (A,B,C) on some S within the same Y, (e.g. every
"manager" within a "division" must have the same ("first name", "last name")
as some "employee" within the same "division") then define a keyref within
the definition of Y with a selector that selects R from Y, and fields that
select I, J, and K from R.
The one that requires a clearer head than I have this morning is where the
scope of the keys is different from the scope of the keyrefs...
Michael Kay
From rschloss@u... Fri Jul 30 09:34:47 2004
Re | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
