|
top
|
 Subject: ey/unique that is out of scope Author: (Deleted User) Date: 31 Mar 2005 01:40 PM
|
Hi Nea,
you are indeed doing something that the XML Schema specs don't allow.
You want to reference from the definition of D element a table of key
values built on E elements, but the XML Schema specs, at § 3.11.4
(Identity-constraint Definition Validation Rules), point 4.3 say:
"4.3 If the {identity-constraint category} is keyref, then for each member
of the qualified node set [...], there must be a node table associated
with the {referenced key} in the [identity-constraint table] of the
element information item [...], which must be understood as logically
prior to this clause of this constraint [...]"
The "logically prior" constraint is further expanded in a following note:
"Note: Because the validation of keyref (see clause 4.3) depends on
finding appropriate entries in a element information item's node table,
and node tables are assembled strictly recursively from the node tables
of descendants, only element information items within the sub-tree
rooted at the element information item being validated can be referenced
successfully."
In your case, while validating D, there is no E element yet visible.
If you want to have D reference E, you must move the two definitions
(the xs:key on E and the xs:keyref on D) upwards, probably on the definition
of the root element (the two snippets you provided are very incomplete,
so I cannot find such a common point).
Hope this helps,
Alberto
element of the
|
|
|