There is a way to create a rule like ‘foreign key restricted’ in xsd?
I need to check the existence of an attribute value that is equal to the attribute ‘use’ of a node.
<node use="..." />
<otherNode name="..." />
See the example above, the attribute is set to ‘node’ attribute ‘use’, the value of this attribute must be equal to ‘otherNode’ in the ‘name’ attribute
Set the type of the use attribute to xs:IDREF
and the name attribute to xs:ID.
There’s also an xs:IDREFS type.
An example
…
Gives
So quote must have a ref parameter, which in this case points to a footnote
Hmm would appear that the above was for DTD and doesn’t work however I found this
True key representation
If you have ever attempted to describe a relational database with a complex relationship map using a DTD, you’ve likely had to use the ID-IDREF pointing mechanism. For example, in a structure where two entities are related in a many-to-many way through a relating table (borrowers and assets on a loan application, for example), the simple XML parent-child relationship is insufficient. However, IDs and IDREFs have their own weaknesses: IDs must be unique across an entire document, and IDREF declarations do not specify the type of element an instance of the IDREF attribute must reference. XML Schema provides a way to specify these pointing relationships in much the same way that foreign-key relationships are declared in a relational database. For example, say you have a foreign-key relationship that you can’t express using a simple parent-child relationship in our XML. You can declare the two related elements as in Listing 3:
Which is even better as you can link id and reference properly.
Have a plus I’m learning stuff.