Is it even possible?
- I know it’s possible to do a restriction based on regex, but that’s not it
- I know it’s possible to declare an attribute as a foreign key calculated by an XPath, but it seems it has to be unique
Exemple:
<root children="2">
<child />
<child />
</root>
W3C Schema 1.0 doesn’t have the ability to constrain the attribute values based upon the instance document.
Schematron is a great tool for validating that documents adhere to such custom validation scenarios.
For example: