Page 1 of 1

Force reference for everey instance of a key attribute

Posted: Wed Feb 07, 2007 7:39 pm
by liehrum
Hi,

i want to define an XML Schema with a key attribute inside one element and a keyref attribute inside another element referencing to this key. Thats no problem at all. Additionally I want to enforce, that every key will be hit by at least one keyref, so that the xml-code below would be not validated, because a2key is not referenced by any keyref.

Code: Select all

<a name="a1"  key="a1key"/>
<a name="a2" key="a2key"/>
<b name="b1" keyref="a1key"/>
<b name="b2" keyref="a1key"/>

Knows anyone a solution for that problem?[/b]

Posted: Thu Jun 14, 2007 6:01 pm
by robert
As I know, XML Schema with a keyref attribute don't support this, you need looking for another way. :wink: