Reputation:
I want to provide my own message from the validation done in DocumentBuilder
, rather than the one from XMLMessages.properties
.
Now I see that a property error-reporter
needs to be set to a class which extends XMLErrorReporter
.
However, I've not been able to get ComponentManager
from Document
/Builder
/Factory
.
Doing parsing of string in SAXParseException
is the last option, but I'm just thinking there may be a 'best practice' way of doing it.
Upvotes: 2
Views: 388
Reputation: 6131
have you already looked at DocumentBuilder#setErrorHandler?
if yes, could you explain why this approach doesn't work for you?
Upvotes: 2