javaxml-parsingfasterxmlwoodstox

Can Woodstox Error Messages be customized


I would like to use Woodstox for XML-Parsing/Writing from within an GUI which should show error-messages that occur during XML-Parsing/Writing to a user.

Does Woodstox provide a way to customize all error-messages that occur during parsing/writing. I do not want to show to the user that i use woodstox, and i would also not like to show internal things like Java-Classes or java-specific error-messages within the error-message.

For Example:

Does Woodstox provide something like this, and how can it be used?


Solution

  • No, there is no localization support yet.

    Since exceptions are sort of internal anyway, direct localization of messages does not make that much sense. But addition of formal error codes in Exceptions seems like a good improvement (Stax spec/API does not have those, but Woodstox implementation types could, either directly, or as tag interface). One potential challenge might be that of how to templatize things (how to add pertinent pieces of information within message). But adding error codes seems like a good start.

    To get that done, you would file an issue. It is also likely that to actually get it implemented, a Pull Request (that is, proposed implementation) would be needed.