Skip to content

Commit

Permalink
Indentation disappears with custom escape handler
Browse files Browse the repository at this point in the history
If a custom escape handler is set in combination with the JAXB_FORMATTED_OUTPUT option, the tabs are not printed as the tab() call expects the escaped value in the os stream.

I haven't done any significant testing with this fix.

Signed-off-by: Kristof Dhondt <kristofdho@gmail.com>
  • Loading branch information
kkriske authored and kristofdho committed Aug 7, 2020
1 parent 83e58aa commit 3d92da7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ protected void writeValue(String value, boolean escapeChars, boolean isAttribute
CharArrayWriter out = new CharArrayWriter();
escapeHandler.escape(value.toCharArray(), 0, value.length(), isAttribute, out);
byte[] bytes = out.toString().getBytes();
outputStreamWrite(bytes);
outputStreamWrite(bytes, os);
out.close();
} catch (IOException e) {
throw XMLMarshalException.marshalException(e);
Expand Down

0 comments on commit 3d92da7

Please sign in to comment.