I am trying to develop a scheme for checking the XML format that is already used in the application (there is not much space for redesigning xml).
I am trying to use the key and keyref elements of an XML schema dictionary to verify identity restrictions.
One of the special problems is how xml models relationships from one to several.
<spaceships> <spaceship guns="gun1 gun2 gun3"/> </spaceships> <guns> <gun id="gun1"/> <gun id="gun2"/> <gun id="gun3"/> </guns>
I came up with this key pair / keyref in my circuit
<xs:key name="gunKey"> <xs:selector xpath="guns/gun" /> <xs:field xpath="@id" /> </xs:key> <xs:keyref name="gunRef" refer="gunKey"> <xs:selector xpath="spaceships/spaceship" /> <xs:field xpath="@guns" /> </xs:keyref>
This is not supported by protests against herces:
The key "gunRef" with the value "gun1 gun2 gun3" was not found to limit the identity of the element.
Is there any sense in expressing in the schema that the value of the list is a list of links, separated by commas, to another object and still get the advantage of checking for identity restrictions?
artur
source share