Skip to content

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

@cbxp

Description

@cbxp

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions