diff --git a/testing/resources/openlyrics/openlyrics_schema.rng b/testing/resources/openlyrics/openlyrics_schema.rng new file mode 100644 index 000000000..9df99ecc5 --- /dev/null +++ b/testing/resources/openlyrics/openlyrics_schema.rng @@ -0,0 +1,467 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + words + music + + + + + + translation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -99 + 99 + + + + + + + + + + + 30 + 250 + + + bpm + + + + + + + text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 999 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + optional + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [0-9]+\.[0-9]+(\.[0-9]+)? + + + + + + + + + + + + + + + + + + 1 + + (v[1-9]\d?[a-z]?)|([cpb][a-z]?)|([cpbe][1-9]\d?[a-z]?) + + + + + + + + + + + + + + + + + + + + + + 1 + + + + diff --git a/testing/resources/openlyrics/validate.py b/testing/resources/openlyrics/validate.py new file mode 100755 index 000000000..116f69454 --- /dev/null +++ b/testing/resources/openlyrics/validate.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import sys + +try: + from lxml import etree +except ImportError: + print('Python module "lxml" is required') + exit(1) + + +if len(sys.argv) != 3: + print('Usage: python %s openlyrics_schema.rng xmlfile.xml' % __file__) + exit(1) + + +relaxng_file = sys.argv[1] +xml_file = sys.argv[2] + +relaxng_doc = etree.parse(relaxng_file) +xml_doc = etree.parse(xml_file) + +relaxng = etree.RelaxNG(relaxng_doc) + +relaxng.assertValid(xml_doc) +