I work with the brazilian \"Nota Fiscal Eletronica\" project, in which they define a standart way to sign XML documents.
Recently, they started to require that there
We just need to set the "true" value to the "ignoreLineBreaks" parameter, cause' the default value is false and this allows to the signature API to add LineBreaks
here is the code to avoid or remove LineBreaks
Field f = XMLUtils.class.getDeclaredField("ignoreLineBreaks");
f.setAccessible(true);
f.set(null, Boolean.TRUE);
then, we'll can make sure that the new value is true with the next code line
System.err.println(XMLUtils.ignoreLineBreaks());
I had the same problem and this worked for me.