Instead of transforming your list of acceptable values into RelaxNG form, an alternative possibility is to supplement your RelaxNG schema with a Schematron schema, which is capable of validating attributes against an external list of values. https://schematron.com/