Given this XML file:
<users blessed="phrogz alians">
<user name="phrogz" id="42" />
<user name="lachtok" id="3" />
<user name="vielee" id="5" />
<user name="alians" id="17" />
</users>
…is it possible to create an XSD key/keyref style validation that ensures that each value in the the blessed list matches against an existing user/@name?
If this is not possible with XSD, is it possible with RelaxNG?
No, it’s not possible with XSD 1.0. It’s straightforward in XSD 1.1, of course, using assertions:
Uniqueness (if defined at the level of the users element):
Referential integrity (if defined at the level of the users element):