Major because this issue was raised by a user, and it took me hours to figure it out!
We need to cleanup some code and add tests to show how to do seemingly obvious things with XSD pattern facets that are in fact quite tricky to do, and we've gotten them wrong before in real schemas.
E.g., use a pattern facet to restrict the characters of a string to only the characters with code points less than 7F.
This turns out to be quite tricky due to XML illegal characters, combined with XML attribute normalization.
The correct pattern facet definition is this:
(that has to all be on one line)
Various other combinations do NOT work. E.g., you can't replace the \n by
because XML attribute normalization will take that out.
You can't use Daffodil's
either, because when Xerces-based full validation comes along, there will be an 0x0A in the data, not an 0xE00A, so Xerces will fail validation. You have to use \n for this.