Practical

As mentioned above, rapid cyclic testing is not particularly difficult: just take an XML file that has a test selector on a tei:rendition/@selector, and validate it against the generated RELAX NG schema or transform it with the generated XSLT stylesheet. But I am personally fond of creating self-testing systems, in part because it takes literate programming to a next step, keeping the test cases in with the original documentation and program, thus keeping all the concerns (as it were) in one file; and in part just because it’s cool.

Observing that

I could insert the desired tests directly into the CSS3_selector_regex_generator.perl program such that they would be inserted into the output RELAX NG schema or XSLT program as the value of a tei:rendition/@selector. The regular expression could then be tested against the test CSS selectors by validating the output RELAX NG grammar against itself (that is, use the generated RELAX NG schema as both the grammar and the document instance), or by transforming the XSLT stylesheet with itself (that is, use the generated XSLT program as both the stylesheet and the input document).