New XML Validator class for Xojo
For error and warning messages, we provide them directly via Error and Warning events. We also collect them in an Messages array, which can be useful to check for errors later after validation.
The messages are in XMLValidatorMessageMBS objects, so we can provide the message and metadata like a line number and file name, if possible. Line numbers seem to be correct if you use Unix line endings. For Mac line endings, you get always line 1. So a call to ReplaceLineEndings(XML, endOfLine.Unix) may be useful.
To implement this class, we relay on libxml2 and the validator functions there. As Xojo has built-in XML classes, we have no need to reimplement all of that, but the validation was missing for a client.