TIBCOSoftware / genxdm

GenXDM: XQuery/XPath Data Model API, bridges, and processors for tree-model neutral access to XML.
http://www.genxdm.org/
9 stars 4 forks source link

Add element name (typically from ElementDefinition, not from XML instance) to SimpleTypeException constructor override #172

Closed aalewis-tibco closed 3 years ago

aalewis-tibco commented 6 years ago

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.

aalewis-tibco commented 3 years ago

Resolved with commit c64ec1d1ff33fa3d526e1e1d4cc658df4a3b614b, the same day that this was opened.