Re: xml validation using an xsd file
I did look into this area the best part of ten years ago and in the end did not end up using the xsd for validation
In our case we were mostly creating the XML document to be sent to a government service
If you are reading something from a service you would hope it would conform to their own schema!
I think the reasons (which are a bit hazy now) for not using it were two fold
The first being at the time I did not appreciate how much you could use XPath with df commands and this might have caused me to go further had I known
However ultimately any errors reported need to be comprehensible to the user and code would need to parse the XPath to understand the context of the last element through its parentage. For example if it is something generic like 'amount' or the XML element names are 'teccy' and not obvious to the average user
As we were mostly building the XML and reading some I wrote a set of classes that linked together via Procedure Set and Function that 'communicated' with structs matching the XML that would set/get the child information and any verification/error reporting was all done in DF code
Also if there is an opportunity to correct bad data automatically e.g. truncating it then again DF code would be used.
Ultimately verifying with an XSD is really just a raw problem stater it doesn't give you anything else.
Success consists of going from failure to failure without loss of enthusiasm - Winston Churchill