Which, if I understand it correctly, is the approach taken by Relax NG.
A RELAX NG schema specifies a pattern for the structure and content of an XML document. A RELAX NG schema thus identifies a class of XML documents consisting of those documents that match the pattern. http://xml.coverpages.org/relax.html
(caveat: my knowledge of this is limited to light reading)
Check out:
In reply to Re: Re: Re: Abusing Regular Expressions
by qq
in thread Abusing Regular Expressions
by samtregar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |