Force reference for everey instance of a key attribute

This should cover W3C XML Schema, Relax NG and DTD related problems.
liehrum
Posts: 1
Joined: Wed Feb 07, 2007 7:27 pm

Force reference for everey instance of a key attribute

Post 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]
robert
Posts: 2
Joined: Wed Feb 28, 2007 2:17 am

Post by robert »

As I know, XML Schema with a keyref attribute don't support this, you need looking for another way. :wink:
Post Reply