You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Yes, the XML is not well-formed. That's the point.)
I dug into why this is happening, and the root cause is because a DataInputStream is being used to read the XML file here. DataInputStream cannot be used like this, and a InputStreamReader must be used instead.
JHOVE will not identify an XML document based on having its XML declaration.
For example, suppose you have the following XML:
And execute JHOVE on it:
❯ ./jhove -s /var/tmp/invalid.xml Jhove (Rel. 1.24.1, 2020-03-16) Date: 2021-06-30 15:02:25 CDT RepresentationInformation: /var/tmp/invalid.xml ReportingModule: ASCII-hul, Rel. 1.4.1 (2019-04-17) LastModified: 2021-06-29 13:21:30 CDT Size: 86 Format: ASCII Status: Well-Formed SignatureMatches: ASCII-hul MIMEtype: text/plain; charset=US-ASCII
(Yes, the XML is not well-formed. That's the point.)
I dug into why this is happening, and the root cause is because a
DataInputStream
is being used to read the XML file here.DataInputStream
cannot be used like this, and aInputStreamReader
must be used instead.Here's a demonstration of the problem:
That code produces the following output when run:
The text was updated successfully, but these errors were encountered: