views:

91

answers:

1

Why cant a keyref be a node-set?

For example (under Keys), what if there are multiple <friend-of> tags? If there were multiple tags of <friend-of>, when you check XML well-formedness, it will not pass and give an error along this line:

Field '{anonymous}' of identity constraint 'friendOfIsCharRef' evaluates to a node-set with more than one member.

If a node-set of keyref is not allowed, how do I express the following then?

<some_data>
 <id>12</id>
 <id>13</id>
</some_data>

<other_data>
 <foreign_key>12</foreign_key> <-- good
 <foreign_key>15</foreign_key> <-- bad! because it's neither 12 nor 13.
</other_data>

I was thinking about using enumerator, but I dont think that's right because if another entry is added in <some_data> the enumerator would be unaware of new keys.

A: 

I am facing similar problem.

Algorist