Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DigiDoc4J tries to parse any binary file that added to container as XML #108

Open
cbxp opened this issue Apr 26, 2022 · 0 comments
Open

Comments

@cbxp
Copy link

cbxp commented Apr 26, 2022

Resulting in the following logs in system error every time:
[Fatal Error] :1:1: Content is not allowed in prolog.

This message is written by Xerces (included in the JDK), as a result of the following code in DomUtils:

	public static boolean isDOM(final byte[] bytes) {
		try {
			final Document dom = buildDOM(bytes);
			return dom != null;
		} catch (DSSException e) {
			// NOT DOM
			return false;
		}
	}

The question is, why do you try to parse application/pdf binary content as XML?
If you still do, then please ensure no misleading errors are printed that people need to investigate...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant