openpreserve / jhove

File validation and characterisation.
http://jhove.openpreservation.org
Other
161 stars 78 forks source link

XML-hul: SaxParseException Info still hidden in subMessage attribute #922

Open asciim0 opened 2 months ago

asciim0 commented 2 months ago

I thought there already was an issue for this, but I can't find it anymore.

Back in JHOVE 1.24 the XML-HUL reported out the actual detail of SaxParser errors within the regular message value, e.g.: <message subMessage="Line = 94, Column = 58" severity="error" id="XML-HUL-1">SaxParseException: cvc-attribute.3: The value '0017_DEFAULT' of attribute 'ID' on element 'METS:file' is not valid with respect to its type, 'ID'.</message>

With 1.26 this was changed to the detail being added to the subMessage attribute instead of to the value itself, e.g.: <message subMessage="cvc-attribute.3: The value '0017_DEFAULT' of attribute 'ID' on element 'METS:file' is not valid with respect to its type, 'ID'. Line = 94, Column = 58." severity="error" id="XML-HUL-1">SAXParseException</message>

With 1.30 the behavior of 1.26 and subsequently 1.28 is continued. Is it possible to revert the message reporting back to what it was like in 1.24? The current reporting mechanism prohibits us from using rule-based validation error treatment where the rule in our system is based on the message value and not the subMessage attribute.

samalloing commented 2 months ago

Hi Micky,

You mean https://github.com/openpreserve/jhove/pull/634 I think

Sam

asciim0 commented 2 months ago

yup. thanks for connecting it. so if it has been merged, why wasn't it rolled back as discussed in that issue?

samalloing commented 2 months ago

Hi Micky

You are looking for this https://github.com/openpreserve/jhove/pull/850 pull request I think

Sam

asciim0 commented 2 months ago

Whichever it is, i'd love to see for it to be addressed ;-P It was included in the 1.28 RLs as a fix: "Reverted reporting of XmlParseExceptions so that exception detail is part of message body. [https://github.com/openpreserve/jhove/pull/850]"

@carlwilson - can you give an update on this?