Affects Version/s: 3.1.4
Fix Version/s: None
Component/s: Validating Parser (XML Schema)
Environment:Windows 7, likely also Mac and Linux but didn't check
see: https://stackoverflow.com/questions/39755370/xerces-c-xml-xsd-union-always-collapsing-whitespace for longer discussion.
I find that the problem doesn't care what I union with, or that I union with anything at all. So the simplest demonstration is to add these definitions to the above XSD.
Then Xerces-C rejects this XML as not valid:
<?xml version="1.0" encoding="UTF-8" ?>
<root2 stuff="Hello World	!" />
I think the error message is enlightening:
Notice the space before the '!' where the tab was previously.
Microsoft .Net runtime XML/XSD system reports it as valid.
I have tried adding whitespace=preserve to the "Hello" simple type definition:
This does not help.