We've had pushback on exceptions thrown (usually during validation) for simple types, because they do not provide sufficient context to find the problem (if the string representing the invalid value is sufficiently unique, that can be used, but that's often not the case). Per Aditya Wagle (as demonstrated in pull request 171), we can do this within the validator, in many cases.
So let's do it. Add an override to the SimpleTypeException constructor, change the construction of the message, and where possible (where we have an ElementDefinition, an element's QName, or even just an element's localName), invoke the new constructor.
We've had pushback on exceptions thrown (usually during validation) for simple types, because they do not provide sufficient context to find the problem (if the string representing the invalid value is sufficiently unique, that can be used, but that's often not the case). Per Aditya Wagle (as demonstrated in pull request 171), we can do this within the validator, in many cases.
So let's do it. Add an override to the SimpleTypeException constructor, change the construction of the message, and where possible (where we have an ElementDefinition, an element's QName, or even just an element's localName), invoke the new constructor.